Package org.apache.axiom.mime
Interface Part
-
public interface PartA MIME part.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddiscard()Discard the content of this part.voidfetch()Make sure that this part has been fully read from the underlying stream.BlobgetBlob()Get the content of this part as aBlob.StringgetContentID()Get the content ID of this part, i.e. the value of theContent-IDheader with the enclosing brackets removed.ContentTypegetContentType()Get the content type of this part.DataHandlergetDataHandler()Get the content of this part as aDataHandler.StringgetHeader(String name)Get the value of a specific header.List<Header>getHeaders()Get the headers of this part.InputStreamgetInputStream(boolean preserve)Get the content of this part as anInputStream.
-
-
-
Method Detail
-
getHeader
String getHeader(String name)
Get the value of a specific header. If there are multiple headers with the same name, only the first value is returned.- Parameters:
name- the header name- Returns:
- the value of the header, or
nullif the part doesn't have a header with the given name
-
getContentType
ContentType getContentType()
Get the content type of this part.- Returns:
- the parsed value of the
Content-Typeheader
-
getContentID
String getContentID()
Get the content ID of this part, i.e. the value of theContent-IDheader with the enclosing brackets removed.- Returns:
- the content ID of the part or
nullif the part doesn't have a content ID
-
getInputStream
InputStream getInputStream(boolean preserve)
Get the content of this part as anInputStream.- Parameters:
preserve-trueif the content should be preserved so that it can be read multiple times,falseto discard the content when it is read- Returns:
- the content of the part
-
getDataHandler
DataHandler getDataHandler()
Get the content of this part as aDataHandler.- Returns:
- the content of this part
-
fetch
void fetch()
Make sure that this part has been fully read from the underlying stream.
-
discard
void discard()
Discard the content of this part.
-
-