class MIMEMessage extends AttachmentsDelegate
AttachmentsDelegate implementation that represents a MIME multipart message read from a
stream.| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
attachmentRepoDir |
private java.util.Map |
attachmentsMap
Stores the Data Handlers of the already parsed Mime Body Parts in the order that the attachments
occur in the message.
|
private int |
contentLength |
private javax.mail.internet.ContentType |
contentType
ContentType of the MIME message |
private PartImpl |
currentPart
The MIME part currently being processed.
|
private boolean |
fileCacheEnable |
private int |
fileStorageThreshold |
private DetachableInputStream |
filterIS |
private java.lang.String |
firstPartId |
private static org.apache.commons.logging.Log |
log |
private LifecycleManager |
manager |
private org.apache.james.mime4j.stream.MimeTokenStream |
parser |
private int |
partIndex
partIndex- Number of Mime parts parsed |
private boolean |
partsRequested
boolean Indicating if any data handlers have been directly requested |
private IncomingAttachmentStreams |
streams
Container to hold streams for direct access
|
private boolean |
streamsRequested
boolean Indicating if any streams have been directly requested |
| Constructor and Description |
|---|
MIMEMessage(LifecycleManager manager,
java.io.InputStream inStream,
java.lang.String contentTypeString,
boolean fileCacheEnable,
java.lang.String attachmentRepoDir,
int fileStorageThreshold,
int contentLength) |
| Modifier and Type | Method and Description |
|---|---|
(package private) void |
addDataHandler(java.lang.String contentID,
javax.activation.DataHandler dataHandler) |
private static void |
checkParserState(org.apache.james.mime4j.stream.EntityState state,
org.apache.james.mime4j.stream.EntityState expected) |
private void |
fetchAllParts()
Force reading of all attachments.
|
(package private) java.lang.String |
getAttachmentRepoDir() |
(package private) java.util.Set |
getContentIDs(boolean fetchAll) |
(package private) long |
getContentLength() |
(package private) int |
getContentLengthIfKnown() |
(package private) javax.mail.internet.ContentType |
getContentType() |
(package private) javax.activation.DataHandler |
getDataHandler(java.lang.String contentID) |
(package private) IncomingAttachmentStreams |
getIncomingAttachmentStreams() |
(package private) LifecycleManager |
getLifecycleManager() |
(package private) java.util.Map |
getMap() |
private javax.activation.DataHandler |
getNextPartDataHandler() |
private Part |
getPart() |
(package private) java.lang.String |
getRootPartContentID() |
(package private) java.lang.String |
getRootPartContentType() |
(package private) java.io.InputStream |
getRootPartInputStream(boolean preserve) |
(package private) int |
getThreshold() |
private java.util.List |
readHeaders() |
(package private) void |
removeDataHandler(java.lang.String blobContentID) |
(package private) void |
setLifecycleManager(LifecycleManager manager) |
private static final org.apache.commons.logging.Log log
private final javax.mail.internet.ContentType contentType
ContentType of the MIME messageprivate final int contentLength
private final DetachableInputStream filterIS
private final org.apache.james.mime4j.stream.MimeTokenStream parser
private final java.util.Map attachmentsMap
private int partIndex
partIndex- Number of Mime parts parsedprivate PartImpl currentPart
private IncomingAttachmentStreams streams
private boolean streamsRequested
boolean Indicating if any streams have been directly requestedprivate boolean partsRequested
boolean Indicating if any data handlers have been directly requestedprivate java.lang.String firstPartId
private final boolean fileCacheEnable
private final java.lang.String attachmentRepoDir
private final int fileStorageThreshold
private LifecycleManager manager
MIMEMessage(LifecycleManager manager, java.io.InputStream inStream, java.lang.String contentTypeString, boolean fileCacheEnable, java.lang.String attachmentRepoDir, int fileStorageThreshold, int contentLength) throws OMException
OMExceptionjavax.mail.internet.ContentType getContentType()
getContentType in class AttachmentsDelegateLifecycleManager getLifecycleManager()
getLifecycleManager in class AttachmentsDelegatevoid setLifecycleManager(LifecycleManager manager)
setLifecycleManager in class AttachmentsDelegatejavax.activation.DataHandler getDataHandler(java.lang.String contentID)
getDataHandler in class AttachmentsDelegatevoid addDataHandler(java.lang.String contentID,
javax.activation.DataHandler dataHandler)
addDataHandler in class AttachmentsDelegatevoid removeDataHandler(java.lang.String blobContentID)
removeDataHandler in class AttachmentsDelegatejava.io.InputStream getRootPartInputStream(boolean preserve)
throws OMException
getRootPartInputStream in class AttachmentsDelegateOMExceptionjava.lang.String getRootPartContentID()
getRootPartContentID in class AttachmentsDelegatejava.lang.String getRootPartContentType()
getRootPartContentType in class AttachmentsDelegateIncomingAttachmentStreams getIncomingAttachmentStreams()
getIncomingAttachmentStreams in class AttachmentsDelegateprivate void fetchAllParts()
java.util.Set getContentIDs(boolean fetchAll)
getContentIDs in class AttachmentsDelegatejava.util.Map getMap()
getMap in class AttachmentsDelegatelong getContentLength()
throws java.io.IOException
getContentLength in class AttachmentsDelegatejava.io.IOExceptionprivate javax.activation.DataHandler getNextPartDataHandler()
throws OMException
OMException - throw if content id is null or if two MIME parts contain the same
content-ID & the exceptions throws by getPart()private Part getPart() throws OMException
OMException - if Stream ends while reading the next part...int getThreshold()
java.lang.String getAttachmentRepoDir()
int getContentLengthIfKnown()
private java.util.List readHeaders()
throws java.io.IOException,
org.apache.james.mime4j.MimeException
java.io.IOExceptionorg.apache.james.mime4j.MimeExceptionprivate static void checkParserState(org.apache.james.mime4j.stream.EntityState state,
org.apache.james.mime4j.stream.EntityState expected)
throws java.lang.IllegalStateException
java.lang.IllegalStateException