Package org.apache.axiom.mime
Interface Part
public interface Part
A MIME part.
-
Method Summary
Modifier and TypeMethodDescriptionvoiddiscard()Discard the content of this part.voidfetch()Make sure that this part has been fully read from the underlying stream.getBlob()Get the content of this part as aBlob.Get the content ID of this part, i.e. the value of theContent-IDheader with the enclosing brackets removed.Get the content type of this part.Get the value of a specific header.Get the headers of this part.getInputStream(boolean preserve) Get the content of this part as anInputStream.Get thePartBlobinstance created by the configuredPartBlobFactory.
-
Method Details
-
getHeaders
Get the headers of this part.- Returns:
- the headers
-
getHeader
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
-
getBlob
Blob getBlob()Get the content of this part as aBlob.- Returns:
- the content of this part
-
getPartBlob
PartBlob getPartBlob()Get thePartBlobinstance created by the configuredPartBlobFactory.- Returns:
- the
PartBlobinstance
-
getInputStream
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
-
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.
-