org.apache.axis.attachments
Class MultiPartRelatedInputStream

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

public class MultiPartRelatedInputStream
extends MultiPartInputStream

This simulates the multipart stream

Author:
Rick Rineholt

Field Summary
protected  byte[] boundary
          Field boundary
protected  BoundaryDelimitedStream boundaryDelimitedStream
          Field boundaryDelimitedStream
protected  java.io.ByteArrayInputStream cachedSOAPEnvelope
          Field cachedSOAPEnvelope
protected  boolean closed
          Field closed
protected  java.lang.String contentId
          Field contentId
protected  java.lang.String contentLocation
          Field contentLocation
protected  boolean eos
          Field eos
protected static org.apache.commons.logging.Log log
          Field log
static java.lang.String MIME_MULTIPART_RELATED
          Field MIME_MULTIPART_RELATED
protected  java.util.LinkedList orderedParts
          Field orderedParts
protected  java.util.HashMap parts
          Field parts
protected static java.lang.String[] READ_ALL
          Field READ_ALL
protected  int rootPartLength
          Field rootPartLength
protected  java.io.InputStream soapStream
          Field soapStream
protected  java.io.InputStream soapStreamBDS
          Field soapStreamBDS
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
MultiPartRelatedInputStream(java.lang.String contentType, java.io.InputStream stream)
          Multipart stream.
 
Method Summary
protected  void addPart(java.lang.String contentId, java.lang.String locationId, AttachmentPart ap)
          Method addPart
 void close()
          Method close
 Part getAttachmentByReference(java.lang.String[] id)
          Method getAttachmentByReference
 java.util.Collection getAttachments()
          Method getAttachments
 java.lang.String getContentId()
          Return the content id of the stream
 java.lang.String getContentLocation()
          Return the content location.
 int read()
          Method read
 int read(byte[] b)
          Method read
 int read(byte[] b, int off, int len)
          Read the root stream.
protected  void readAll()
          Method 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
Field log

MIME_MULTIPART_RELATED

public static final java.lang.String MIME_MULTIPART_RELATED
Field MIME_MULTIPART_RELATED

parts

protected java.util.HashMap parts
Field parts

orderedParts

protected java.util.LinkedList orderedParts
Field orderedParts

rootPartLength

protected int rootPartLength
Field rootPartLength

closed

protected boolean closed
Field closed

eos

protected boolean eos
Field eos

boundaryDelimitedStream

protected BoundaryDelimitedStream boundaryDelimitedStream
Field boundaryDelimitedStream

soapStream

protected java.io.InputStream soapStream
Field soapStream

soapStreamBDS

protected java.io.InputStream soapStreamBDS
Field soapStreamBDS

boundary

protected byte[] boundary
Field boundary

cachedSOAPEnvelope

protected java.io.ByteArrayInputStream cachedSOAPEnvelope
Field cachedSOAPEnvelope

contentLocation

protected java.lang.String contentLocation
Field contentLocation

contentId

protected java.lang.String contentId
Field contentId

READ_ALL

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

MultiPartRelatedInputStream

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

getAttachmentByReference

public Part getAttachmentByReference(java.lang.String[] id)
                              throws AxisFault
Method getAttachmentByReference
Overrides:
getAttachmentByReference in class MultiPartInputStream
Parameters:
id -  
Returns:
the attachment Part
Throws:
AxisFault -  

addPart

protected void addPart(java.lang.String contentId,
                       java.lang.String locationId,
                       AttachmentPart ap)
Method addPart
Parameters:
contentId -  
locationId -  
ap -  

readAll

protected void readAll()
                throws AxisFault
Method readAll
Throws:
AxisFault -  

getAttachments

public java.util.Collection getAttachments()
                                    throws AxisFault
Method getAttachments
Overrides:
getAttachments in class MultiPartInputStream
Returns:
the collection of attachments
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:
id - id is the stream being sought.
Returns:
the part for the id
Throws:
AxisFault -  

getContentLocation

public java.lang.String getContentLocation()
Return the content location.
Overrides:
getContentLocation in class MultiPartInputStream
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
Overrides:
getContentId in class MultiPartInputStream
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
Parameters:
b -  
off -  
len -  
Returns:
 
Throws:
java.io.IOException -  

read

public int read(byte[] b)
         throws java.io.IOException
Method read
Overrides:
read in class java.io.FilterInputStream
Parameters:
b -  
Returns:
 
Throws:
java.io.IOException -  

read

public int read()
         throws java.io.IOException
Method read
Overrides:
read in class java.io.FilterInputStream
Returns:
 
Throws:
java.io.IOException -  

close

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


Copyright © 2003 Apache Web Services Project. All Rights Reserved.