Package 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
- All Implemented Interfaces:
Closeable,AutoCloseable
This simulates the multipart stream.
- Author:
- Rick Rineholt
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected byte[]Field boundaryprotected BoundaryDelimitedStreamField boundaryDelimitedStreamprotected ByteArrayInputStreamField cachedSOAPEnvelopeprotected booleanField closedprotected StringField contentIdprotected StringField contentLocationprotected booleanField eosprotected static org.apache.commons.logging.LogField logstatic final StringField MIME_MULTIPART_RELATEDprotected LinkedListField orderedPartsprotected HashMapField partsprotected static final String[]Field READ_ALLprotected intField rootPartLengthprotected InputStreamField soapStreamprotected InputStreamField soapStreamBDSFields inherited from class java.io.FilterInputStream
in -
Constructor Summary
ConstructorsConstructorDescriptionMultiPartRelatedInputStream(String contentType, InputStream stream) Create a new Multipart stream. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddPart(String contentId, String locationId, AttachmentPart ap) Add anAttachmentParttogether with its content and location IDs.intvoidclose()Return the content id of the stream.Return the content location.intread()intread(byte[] b) intread(byte[] b, int off, int len) protected voidreadAll()Read all data.protected PartreadTillFound(String[] id) This will read streams in till the one that is needed is found.Methods inherited from class java.io.FilterInputStream
mark, markSupported, reset, skipMethods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Field Details
-
log
protected static org.apache.commons.logging.Log logField log -
MIME_MULTIPART_RELATED
Field MIME_MULTIPART_RELATED- See Also:
-
parts
Field parts -
orderedParts
Field orderedParts -
rootPartLength
protected int rootPartLengthField rootPartLength -
closed
protected boolean closedField closed -
eos
protected boolean eosField eos -
boundaryDelimitedStream
Field boundaryDelimitedStream -
soapStream
Field soapStream -
soapStreamBDS
Field soapStreamBDS -
boundary
protected byte[] boundaryField boundary -
cachedSOAPEnvelope
Field cachedSOAPEnvelope -
contentLocation
Field contentLocation -
contentId
Field contentId -
READ_ALL
Field READ_ALL
-
-
Constructor Details
-
MultiPartRelatedInputStream
Create a new Multipart stream.- Parameters:
contentType- the string that holds the contentTypestream- the true input stream from where the source- Throws:
AxisFault- if the stream could not be created
-
-
Method Details
-
getAttachmentByReference
- Specified by:
getAttachmentByReferencein classMultiPartInputStream- Throws:
AxisFault
-
addPart
Add anAttachmentParttogether with its content and location IDs.- Parameters:
contentId- the content IDlocationId- the location IDap- theAttachmentPart
-
readAll
Read all data.- Throws:
AxisFault- if there was a problem reading all the data
-
getAttachments
- Specified by:
getAttachmentsin classMultiPartInputStream- Throws:
AxisFault
-
readTillFound
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
Description copied from class:MultiPartInputStreamReturn the content location.- Specified by:
getContentLocationin classMultiPartInputStream- Returns:
- the Content-Location of the stream. Null if no content-location specified.
-
getContentId
Description copied from class:MultiPartInputStreamReturn the content id of the stream.- Specified by:
getContentIdin classMultiPartInputStream- Returns:
- the Content-Location of the stream. Null if no content-location specified.
-
read
- Overrides:
readin classFilterInputStream- Throws:
IOException
-
read
- Overrides:
readin classFilterInputStream- Throws:
IOException
-
read
- Overrides:
readin classFilterInputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classFilterInputStream- Throws:
IOException
-
available
- Overrides:
availablein classFilterInputStream- Throws:
IOException
-