Package org.apache.axiom.attachments
Class IncomingAttachmentInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.apache.axiom.attachments.IncomingAttachmentInputStream
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class IncomingAttachmentInputStream extends InputStream
-
-
Field Summary
Fields Modifier and Type Field Description static StringHEADER_CONTENT_DESCRIPTIONstatic StringHEADER_CONTENT_IDstatic StringHEADER_CONTENT_LENGTHstatic StringHEADER_CONTENT_LOCATIONstatic StringHEADER_CONTENT_TRANSFER_ENCODINGstatic StringHEADER_CONTENT_TYPE
-
Constructor Summary
Constructors Constructor Description IncomingAttachmentInputStream(InputStream in, IncomingAttachmentStreams parentContainer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddHeader(String name, String value)Add a header.StringgetContentId()StringgetContentLocation()StringgetContentType()StringgetHeader(String name)Get a header value.Map<String,String>getHeaders()voidmark(int readLimit)booleanmarkSupported()Don't want to support mark and reset since this may get us into concurrency problem when different pieces of software may have a handle to the underlying InputStream.intread()intread(byte[] b)intread(byte[] b, int off, int len)voidreset()-
Methods inherited from class java.io.InputStream
available, close, nullInputStream, readAllBytes, readNBytes, readNBytes, skip, transferTo
-
-
-
-
Field Detail
-
HEADER_CONTENT_DESCRIPTION
public static final String HEADER_CONTENT_DESCRIPTION
- See Also:
- Constant Field Values
-
HEADER_CONTENT_TYPE
public static final String HEADER_CONTENT_TYPE
- See Also:
- Constant Field Values
-
HEADER_CONTENT_TRANSFER_ENCODING
public static final String HEADER_CONTENT_TRANSFER_ENCODING
- See Also:
- Constant Field Values
-
HEADER_CONTENT_LENGTH
public static final String HEADER_CONTENT_LENGTH
- See Also:
- Constant Field Values
-
HEADER_CONTENT_LOCATION
public static final String HEADER_CONTENT_LOCATION
- See Also:
- Constant Field Values
-
HEADER_CONTENT_ID
public static final String HEADER_CONTENT_ID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
IncomingAttachmentInputStream
public IncomingAttachmentInputStream(InputStream in, IncomingAttachmentStreams parentContainer)
- Parameters:
in-
-
-
Method Detail
-
getHeaders
public Map<String,String> getHeaders()
- Returns:
- MIME headers for this attachment. May be null if no headers were set.
-
addHeader
public void addHeader(String name, String value)
Add a header.- Parameters:
name-value-
-
getHeader
public String getHeader(String name)
Get a header value.- Parameters:
name-- Returns:
- The header found or null if not found.
-
getContentId
public String getContentId()
- Returns:
- The header with HTTPConstants.HEADER_CONTENT_ID as the key.
-
getContentLocation
public String getContentLocation()
- Returns:
- The header with HTTPConstants.HEADER_CONTENT_LOCATION as the key.
-
getContentType
public String getContentType()
- Returns:
- The header with HTTPConstants.HEADER_CONTENT_TYPE as the key.
-
markSupported
public boolean markSupported()
Don't want to support mark and reset since this may get us into concurrency problem when different pieces of software may have a handle to the underlying InputStream.- Overrides:
markSupportedin classInputStream
-
reset
public void reset() throws IOException- Overrides:
resetin classInputStream- Throws:
IOException
-
mark
public void mark(int readLimit)
- Overrides:
markin classInputStream
-
read
public int read() throws IOException- Specified by:
readin classInputStream- Throws:
IOException
-
read
public int read(byte[] b) throws IOException- Overrides:
readin classInputStream- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) throws IOException- Overrides:
readin classInputStream- Throws:
IOException
-
-