Package org.apache.axis.attachments
Class MultiPartDimeInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
org.apache.axis.attachments.MultiPartInputStream
org.apache.axis.attachments.MultiPartDimeInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
This simulates the multipart stream.
- Author:
- Rick Rineholt
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected byte[]
protected ByteArrayInputStream
protected boolean
protected String
protected DimeDelimitedInputStream
protected boolean
protected static org.apache.commons.logging.Log
protected LinkedList
protected HashMap
protected static final String[]
protected int
protected InputStream
Fields inherited from class java.io.FilterInputStream
in
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a new Multipart stream from an input stream. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addPart
(String contentId, String locationId, AttachmentPart ap) 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()
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
available, 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 log -
parts
-
orderedParts
-
rootPartLength
protected int rootPartLength -
closed
protected boolean closed -
eos
protected boolean eos -
dimeDelimitedStream
-
soapStream
-
boundary
protected byte[] boundary -
cachedSOAPEnvelope
-
contentId
-
READ_ALL
-
-
Constructor Details
-
MultiPartDimeInputStream
Create a new Multipart stream from an input stream.- Parameters:
is
- the true input stream that is read from- Throws:
IOException
- if it was not possible to build the Multipart
-
-
Method Details
-
getAttachmentByReference
- Specified by:
getAttachmentByReference
in classMultiPartInputStream
- Throws:
AxisFault
-
addPart
-
readAll
- Throws:
AxisFault
-
getAttachments
- Specified by:
getAttachments
in classMultiPartInputStream
- Throws:
AxisFault
-
readTillFound
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 - Throws:
IOException
-
getContentLocation
Return the content location.- Specified by:
getContentLocation
in classMultiPartInputStream
- Returns:
- the Content-Location of the stream. Null if no content-location specified.
-
getContentId
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
-