org.apache.axis.attachments
Class MultiPartRelatedInputStream

java.lang.Object
  |
  +--java.io.InputStream
        |
        +--java.io.FilterInputStream
              |
              +--org.apache.axis.attachments.MultiPartRelatedInputStream

public class MultiPartRelatedInputStream
extends java.io.FilterInputStream

This simulates the multipart stream


Field Summary
protected  byte[] boundary
           
protected  BoundaryDelimitedStream boundaryDelimitedStream
           
protected  java.io.ByteArrayInputStream cachedSOAPEnvelope
           
protected  boolean closed
           
protected  java.lang.String contentId
           
protected  java.lang.String contentLocation
           
protected  boolean eos
           
protected  java.io.InputStream is
           
protected static org.apache.commons.logging.Log log
           
static java.lang.String MIME_MULTIPART_RELATED
           
protected  java.util.LinkedList orderedParts
           
protected  java.util.HashMap parts
           
protected static java.lang.String[] READ_ALL
           
protected  int rootPartLength
           
protected  java.io.InputStream soapStream
           
protected  java.io.InputStream soapStreamBDS
           
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
MultiPartRelatedInputStream(java.lang.String contentType, java.io.InputStream is)
          Multipart stream.
 
Method Summary
protected  void addPart(java.lang.String contentId, java.lang.String locationId, AttachmentPart ap)
           
 void close()
           
 Part getAttachmentByReference(java.lang.String[] id)
           
 java.util.Collection getAttachments()
           
 java.lang.String getContentId()
          Return the content id of the stream
 java.lang.String getContentLocation()
          Return the content location.
 int read()
           
 int read(byte[] b)
           
 int read(byte[] b, int off, int len)
          Read the root stream.
protected  void readAll()
           
protected  Part readTillFound(java.lang.String[] id)
          This will read streams in till the one that is needed is found.
 
Methods inherited from class java.io.FilterInputStream
available, mark, markSupported, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.apache.commons.logging.Log log

MIME_MULTIPART_RELATED

public static final java.lang.String MIME_MULTIPART_RELATED

parts

protected java.util.HashMap parts

orderedParts

protected java.util.LinkedList orderedParts

rootPartLength

protected int rootPartLength

closed

protected boolean closed

eos

protected boolean eos

is

protected java.io.InputStream is

boundaryDelimitedStream

protected BoundaryDelimitedStream boundaryDelimitedStream

soapStream

protected java.io.InputStream soapStream

soapStreamBDS

protected java.io.InputStream soapStreamBDS

boundary

protected byte[] boundary

cachedSOAPEnvelope

protected java.io.ByteArrayInputStream cachedSOAPEnvelope

contentLocation

protected java.lang.String contentLocation

contentId

protected java.lang.String contentId

READ_ALL

protected static final java.lang.String[] READ_ALL
Constructor Detail

MultiPartRelatedInputStream

public MultiPartRelatedInputStream(java.lang.String contentType,
                                   java.io.InputStream is)
                            throws AxisFault
Multipart stream.
Parameters:
the - string that holds the contentType
is - the true input stream from where the source.
Method Detail

getAttachmentByReference

public Part getAttachmentByReference(java.lang.String[] id)
                              throws AxisFault

addPart

protected void addPart(java.lang.String contentId,
                       java.lang.String locationId,
                       AttachmentPart ap)

readAll

protected void readAll()
                throws AxisFault

getAttachments

public java.util.Collection getAttachments()
                                    throws AxisFault

readTillFound

protected Part readTillFound(java.lang.String[] id)
                      throws AxisFault
This will read streams in till the one that is needed is found.
Parameters:
The - id is the stream being sought. TODO today its only handles CID. all ContentId streams should be prefixed by "cid:"

getContentLocation

public java.lang.String getContentLocation()
Return the content location.
Returns:
the Content-Location of the stream. Null if no content-location specified.

getContentId

public java.lang.String getContentId()
Return the content id of the stream
Returns:
the Content-Location of the stream. Null if no content-location specified.

read

public int read(byte[] b,
                int off,
                int len)
         throws java.io.IOException
Read the root stream.
Overrides:
read in class java.io.FilterInputStream

read

public int read(byte[] b)
         throws java.io.IOException
Overrides:
read in class java.io.FilterInputStream

read

public int read()
         throws java.io.IOException
Overrides:
read in class java.io.FilterInputStream

close

public void close()
           throws java.io.IOException
Overrides:
close in class java.io.FilterInputStream


Copyright © 2001 Apache XML Project. All Rights Reserved.