org.apache.axis.attachments

Class MultiPartDimeInputStream

public class MultiPartDimeInputStream extends MultiPartInputStream

This simulates the multipart stream.

Author: Rick Rineholt

Field Summary
protected byte[]boundary
protected ByteArrayInputStreamcachedSOAPEnvelope
protected booleanclosed
protected StringcontentId
protected DimeDelimitedInputStreamdimeDelimitedStream
protected booleaneos
protected static Loglog
protected LinkedListorderedParts
protected HashMapparts
protected introotPartLength
protected static String[]READ_ALL
protected InputStreamsoapStream
Constructor Summary
MultiPartDimeInputStream(InputStream is)
Create a new Multipart stream from an input stream.
Method Summary
protected voidaddPart(String contentId, String locationId, AttachmentPart ap)
voidclose()
PartgetAttachmentByReference(String[] id)
CollectiongetAttachments()
StringgetContentId()
Return the content id of the stream.
StringgetContentLocation()
Return the content location.
intread(byte[] b, int off, int len)
intread(byte[] b)
intread()
protected voidreadAll()
protected PartreadTillFound(String[] id)
This will read streams in till the one that is needed is found.

Field Detail

boundary

protected byte[] boundary

cachedSOAPEnvelope

protected ByteArrayInputStream cachedSOAPEnvelope

closed

protected boolean closed

contentId

protected String contentId

dimeDelimitedStream

protected DimeDelimitedInputStream dimeDelimitedStream

eos

protected boolean eos

log

protected static Log log

orderedParts

protected LinkedList orderedParts

parts

protected HashMap parts

rootPartLength

protected int rootPartLength

READ_ALL

protected static final String[] READ_ALL

soapStream

protected InputStream soapStream

Constructor Detail

MultiPartDimeInputStream

public MultiPartDimeInputStream(InputStream is)
Create a new Multipart stream from an input stream.

Parameters: is the true input stream that is read from

Throws: java.io.IOException if it was not possible to build the Multipart

Method Detail

addPart

protected void addPart(String contentId, String locationId, AttachmentPart ap)

close

public void close()

getAttachmentByReference

public Part getAttachmentByReference(String[] id)

getAttachments

public Collection getAttachments()

getContentId

public String getContentId()
Return the content id of the stream.

Returns: the Content-Location of the stream. Null if no content-location specified.

getContentLocation

public String getContentLocation()
Return the content location.

Returns: the Content-Location of the stream. Null if no content-location specified.

read

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

read

public int read(byte[] b)

read

public int read()

readAll

protected void readAll()

readTillFound

protected Part readTillFound(String[] id)
This will read streams in till the one that is needed is found.

Parameters: id is the stream being sought

Returns: a Part matching the ids

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