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 BoundaryDelimitedStream
Field boundaryDelimitedStreamprotected ByteArrayInputStream
Field cachedSOAPEnvelopeprotected boolean
Field closedprotected String
Field contentIdprotected String
Field contentLocationprotected boolean
Field eosprotected static org.apache.commons.logging.Log
Field logstatic final String
Field MIME_MULTIPART_RELATEDprotected LinkedList
Field orderedPartsprotected HashMap
Field partsprotected static final String[]
Field READ_ALLprotected int
Field rootPartLengthprotected InputStream
Field soapStreamprotected InputStream
Field 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 void
addPart
(String contentId, String locationId, AttachmentPart ap) Add anAttachmentPart
together with its content and location IDs.int
void
close()
Return the content id of the stream.Return the content location.int
read()
int
read
(byte[] b) int
read
(byte[] b, int off, int len) protected void
readAll()
Read all data.protected Part
readTillFound
(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, skip
Methods 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:
getAttachmentByReference
in classMultiPartInputStream
- Throws:
AxisFault
-
addPart
Add anAttachmentPart
together 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:
getAttachments
in 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:MultiPartInputStream
Return the content location.- Specified by:
getContentLocation
in classMultiPartInputStream
- Returns:
- the Content-Location of the stream. Null if no content-location specified.
-
getContentId
Description copied from class:MultiPartInputStream
Return the content id of the stream.- Specified by:
getContentId
in classMultiPartInputStream
- Returns:
- the Content-Location of the stream. Null if no content-location specified.
-
read
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classFilterInputStream
- Throws:
IOException
-
available
- Overrides:
available
in classFilterInputStream
- Throws:
IOException
-