Package org.apache.axiom.mime
Interface Part
public interface Part
A MIME part.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
discard()
Discard the content of this part.void
fetch()
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-ID
header 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 thePartBlob
instance 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
null
if 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-Type
header
-
getContentID
String getContentID()Get the content ID of this part, i.e. the value of theContent-ID
header with the enclosing brackets removed.- Returns:
- the content ID of the part or
null
if 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 thePartBlob
instance created by the configuredPartBlobFactory
.- Returns:
- the
PartBlob
instance
-
getInputStream
Get the content of this part as anInputStream
.- Parameters:
preserve
-true
if the content should be preserved so that it can be read multiple times,false
to 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.
-