org.apache.axis.attachments

Class MultiPartRelatedInputStream

public class MultiPartRelatedInputStream extends MultiPartInputStream

This simulates the multipart stream.

Author: Rick Rineholt

Field Summary
protected byte[]boundary
Field boundary
protected BoundaryDelimitedStreamboundaryDelimitedStream
Field boundaryDelimitedStream
protected ByteArrayInputStreamcachedSOAPEnvelope
Field cachedSOAPEnvelope
protected booleanclosed
Field closed
protected StringcontentId
Field contentId
protected StringcontentLocation
Field contentLocation
protected booleaneos
Field eos
protected static Loglog
Field log
static StringMIME_MULTIPART_RELATED
Field MIME_MULTIPART_RELATED
protected LinkedListorderedParts
Field orderedParts
protected HashMapparts
Field parts
protected introotPartLength
Field rootPartLength
protected static String[]READ_ALL
Field READ_ALL
protected InputStreamsoapStream
Field soapStream
protected InputStreamsoapStreamBDS
Field soapStreamBDS
Constructor Summary
MultiPartRelatedInputStream(String contentType, InputStream stream)
Create a new Multipart stream.
Method Summary
protected voidaddPart(String contentId, String locationId, AttachmentPart ap)
Add an AttachmentPart together with its content and location IDs.
intavailable()
voidclose()
PartgetAttachmentByReference(String[] id)
CollectiongetAttachments()
StringgetContentId()
StringgetContentLocation()
intread(byte[] b, int off, int len)
intread(byte[] b)
intread()
protected voidreadAll()
Read all data.
protected PartreadTillFound(String[] id)
This will read streams in till the one that is needed is found.

Field Detail

boundary

protected byte[] boundary
Field boundary

boundaryDelimitedStream

protected BoundaryDelimitedStream boundaryDelimitedStream
Field boundaryDelimitedStream

cachedSOAPEnvelope

protected ByteArrayInputStream cachedSOAPEnvelope
Field cachedSOAPEnvelope

closed

protected boolean closed
Field closed

contentId

protected String contentId
Field contentId

contentLocation

protected String contentLocation
Field contentLocation

eos

protected boolean eos
Field eos

log

protected static Log log
Field log

MIME_MULTIPART_RELATED

public static final String MIME_MULTIPART_RELATED
Field MIME_MULTIPART_RELATED

orderedParts

protected LinkedList orderedParts
Field orderedParts

parts

protected HashMap parts
Field parts

rootPartLength

protected int rootPartLength
Field rootPartLength

READ_ALL

protected static final String[] READ_ALL
Field READ_ALL

soapStream

protected InputStream soapStream
Field soapStream

soapStreamBDS

protected InputStream soapStreamBDS
Field soapStreamBDS

Constructor Detail

MultiPartRelatedInputStream

public MultiPartRelatedInputStream(String contentType, InputStream stream)
Create a new Multipart stream.

Parameters: contentType the string that holds the contentType stream the true input stream from where the source

Throws: org.apache.axis.AxisFault if the stream could not be created

Method Detail

addPart

protected void addPart(String contentId, String locationId, AttachmentPart ap)
Add an AttachmentPart together with its content and location IDs.

Parameters: contentId the content ID locationId the location ID ap the AttachmentPart

available

public int available()

close

public void close()

getAttachmentByReference

public Part getAttachmentByReference(String[] id)

getAttachments

public Collection getAttachments()

getContentId

public String getContentId()

getContentLocation

public String getContentLocation()

read

public int read(byte[] b, int off, int len)

read

public int read(byte[] b)

read

public int read()

readAll

protected void readAll()
Read all data.

Throws: org.apache.axis.AxisFault if there was a problem reading all the data

readTillFound

protected Part readTillFound(String[] id)
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: org.apache.axis.AxisFault

Copyright B) 2005 Apache Web Services Project. All Rights Reserved.