| Modifier and Type | Field and Description |
|---|---|
private PartContent |
content
The content of this part.
|
private javax.activation.DataHandler |
dataHandler |
private DetachableInputStream |
detachableInputStream |
private java.util.List |
headers |
private boolean |
isRootPart |
private static org.apache.commons.logging.Log |
log |
private MIMEMessage |
message |
private org.apache.james.mime4j.stream.MimeTokenStream |
parser
The MIME parser from which the content of this part is read.
|
private int |
state |
private static int |
STATE_BUFFERED
The part has been read into a memory or file based buffer.
|
private static int |
STATE_DISCARDED
The part content has been discarded and can no longer be read.
|
private static int |
STATE_STREAMING
The part content is being streamed, i.a.
|
private static int |
STATE_UNREAD
The part has not been read yet.
|
| Constructor and Description |
|---|
PartImpl(MIMEMessage message,
boolean isRootPart,
java.util.List headers,
org.apache.james.mime4j.stream.MimeTokenStream parser)
The actual parts are constructed with the PartFactory.
|
| Modifier and Type | Method and Description |
|---|---|
private static void |
checkParserState(org.apache.james.mime4j.stream.EntityState state,
org.apache.james.mime4j.stream.EntityState expected) |
(package private) void |
fetch()
Make sure that the MIME part has been fully read from the parser.
|
private PartContent |
getContent() |
java.lang.String |
getContentID() |
java.lang.String |
getContentType() |
javax.activation.DataHandler |
getDataHandler() |
(package private) javax.activation.DataSource |
getDataSource() |
(package private) java.lang.String |
getDataSourceContentType()
Get the content type that should be reported by
DataSource instances created for this
part. |
java.lang.String |
getHeader(java.lang.String name)
Get the value of a specific header
|
(package private) java.io.InputStream |
getInputStream(boolean preserve) |
long |
getSize() |
private void |
moveToNextPart() |
(package private) void |
releaseContent() |
(package private) void |
writeTo(java.io.OutputStream out) |
private static final int STATE_UNREAD
EntityState.T_BODY.private static final int STATE_BUFFERED
private static final int STATE_STREAMING
private static final int STATE_DISCARDED
private static final org.apache.commons.logging.Log log
private final MIMEMessage message
private final boolean isRootPart
private java.util.List headers
private int state
private org.apache.james.mime4j.stream.MimeTokenStream parser
STATE_UNREAD or STATE_STREAMING.private PartContent content
STATE_BUFFERED.private final javax.activation.DataHandler dataHandler
private DetachableInputStream detachableInputStream
PartImpl(MIMEMessage message, boolean isRootPart, java.util.List headers, org.apache.james.mime4j.stream.MimeTokenStream parser)
headers - PartContentFactorypublic java.lang.String getHeader(java.lang.String name)
Partpublic java.lang.String getContentID()
getContentID in interface Partpublic java.lang.String getContentType()
getContentType in interface Partjava.lang.String getDataSourceContentType()
DataSource instances created for this
part.public javax.activation.DataHandler getDataHandler()
getDataHandler in interface Partprivate PartContent getContent()
private static void checkParserState(org.apache.james.mime4j.stream.EntityState state,
org.apache.james.mime4j.stream.EntityState expected)
throws java.lang.IllegalStateException
java.lang.IllegalStateExceptionvoid fetch()
private void moveToNextPart()
java.io.InputStream getInputStream(boolean preserve)
throws java.io.IOException
java.io.IOExceptionjavax.activation.DataSource getDataSource()
void writeTo(java.io.OutputStream out)
throws java.io.IOException
java.io.IOExceptionvoid releaseContent()
throws java.io.IOException
java.io.IOException