org.apache.axis.attachments

Class MultiPartRelatedInputStream


public class MultiPartRelatedInputStream
extends MultiPartInputStream

This simulates the multipart stream.

Author:
Rick Rineholt

Field Summary

static String
MIME_MULTIPART_RELATED
Field MIME_MULTIPART_RELATED
protected static String[]
READ_ALL
Field READ_ALL
protected byte[]
boundary
Field boundary
protected BoundaryDelimitedStream
boundaryDelimitedStream
Field boundaryDelimitedStream
protected java.io.ByteArrayInputStream
cachedSOAPEnvelope
Field cachedSOAPEnvelope
protected boolean
closed
Field closed
protected String
contentId
Field contentId
protected String
contentLocation
Field contentLocation
protected boolean
eos
Field eos
protected static Log
log
Field log
protected java.util.LinkedList
orderedParts
Field orderedParts
protected java.util.HashMap
parts
Field parts
protected int
rootPartLength
Field rootPartLength
protected java.io.InputStream
soapStream
Field soapStream
protected java.io.InputStream
soapStreamBDS
Field soapStreamBDS

Constructor Summary

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

Method Summary

protected void
addPart(String contentId, String locationId, AttachmentPart ap)
Add an AttachmentPart together with its content and location IDs.
int
available()
void
close()
Part
getAttachmentByReference(String[] id)
java.util.Collection
getAttachments()
String
getContentId()
Return the content id of the stream.
String
getContentLocation()
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 org.apache.axis.attachments.MultiPartInputStream

getAttachmentByReference, getAttachments, getContentId, getContentLocation

Field Details

MIME_MULTIPART_RELATED

public static final String MIME_MULTIPART_RELATED
Field MIME_MULTIPART_RELATED


READ_ALL

protected static final String[] READ_ALL
Field READ_ALL


boundary

protected byte[] boundary
Field boundary


boundaryDelimitedStream

protected BoundaryDelimitedStream boundaryDelimitedStream
Field boundaryDelimitedStream


cachedSOAPEnvelope

protected java.io.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


orderedParts

protected java.util.LinkedList orderedParts
Field orderedParts


parts

protected java.util.HashMap parts
Field parts


rootPartLength

protected int rootPartLength
Field rootPartLength


soapStream

protected java.io.InputStream soapStream
Field soapStream


soapStreamBDS

protected java.io.InputStream soapStreamBDS
Field soapStreamBDS

Constructor Details

MultiPartRelatedInputStream

public MultiPartRelatedInputStream(String contentType,
                                   java.io.InputStream stream)
            throws AxisFault
Create a new Multipart stream.

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

Throws:
AxisFault - if the stream could not be created

Method Details

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()
            throws java.io.IOException


close

public void close()
            throws java.io.IOException


getAttachmentByReference

public Part getAttachmentByReference(String[] id)
            throws AxisFault
Overrides:
getAttachmentByReference in interface MultiPartInputStream


getAttachments

public java.util.Collection getAttachments()
            throws AxisFault
Overrides:
getAttachments in interface MultiPartInputStream


getContentId

public String getContentId()
Return the content id of the stream.
Overrides:
getContentId in interface MultiPartInputStream

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


getContentLocation

public String getContentLocation()
Return the content location.
Overrides:
getContentLocation in interface MultiPartInputStream

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


read

public int read()
            throws java.io.IOException


read

public int read(byte[] b)
            throws java.io.IOException


read

public int read(byte[] b,
                int off,
                int len)
            throws java.io.IOException


readAll

protected void readAll()
            throws AxisFault
Read all data.

Throws:
AxisFault - if there was a problem reading all the data


readTillFound

protected Part readTillFound(String[] id)
            throws AxisFault
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 -


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