|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.axiom.attachments.Attachments
public class Attachments
Field Summary | |
---|---|
(package private) java.lang.String |
applicationType
applicationType used to distinguish between MTOM & SWA If the message is MTOM
optimised type is application/xop+xml If the message is SWA, type is ??have to find out |
private java.lang.String |
attachmentRepoDir
|
(package private) java.util.TreeMap |
attachmentsMap
attachmentsMap stores the Data Handlers of the already parsed Mime Body Parts. |
(package private) byte[] |
boundary
Mime boundary which separates mime parts |
(package private) java.util.ArrayList |
cids
cids stores the content ids in the order that the attachments
occur in the message |
(package private) int |
contentLength
|
(package private) javax.mail.internet.ContentType |
contentType
ContentType of the MIME message |
private boolean |
endOfStreamReached
endOfStreamReached flag which is to be set by MIMEBodyPartStream when MIME
message terminator is found. |
private boolean |
fileCacheEnable
|
private int |
fileStorageThreshold
|
private java.lang.String |
firstPartId
|
protected static org.apache.commons.logging.Log |
log
|
private LifecycleManager |
manager
|
private boolean |
noStreams
noStreams flag which is to be set when this class is instantiated by the SwA API
to handle programatic added attachements. |
(package private) int |
partIndex
partIndex - Number of Mime parts parsed |
private boolean |
partsRequested
boolean Indicating if any data handlers have been directly requested |
(package private) int |
PUSHBACK_SIZE
|
(package private) java.io.PushbackInputStream |
pushbackInStream
pushbackInStream stores the reference to the incoming stream A PushbackStream
has the ability to "push back" or "unread" one byte. |
(package private) IncomingAttachmentStreams |
streams
Container to hold streams for direct access |
private boolean |
streamsRequested
boolean Indicating if any streams have been directly requested |
Constructor Summary | |
---|---|
Attachments()
Use this constructor when instantiating this to store the attachments set programatically through the SwA API. |
|
Attachments(java.io.InputStream inStream,
java.lang.String contentTypeString)
Sets file cache to false. |
|
Attachments(java.io.InputStream inStream,
java.lang.String contentTypeString,
boolean fileCacheEnable,
java.lang.String attachmentRepoDir,
java.lang.String fileThreshold)
Moves the pointer to the beginning of the first MIME part. |
|
Attachments(java.io.InputStream inStream,
java.lang.String contentTypeString,
boolean fileCacheEnable,
java.lang.String attachmentRepoDir,
java.lang.String fileThreshold,
int contentLength)
Moves the pointer to the beginning of the first MIME part. |
|
Attachments(LifecycleManager manager,
java.io.InputStream inStream,
java.lang.String contentTypeString,
boolean fileCacheEnable,
java.lang.String attachmentRepoDir,
java.lang.String fileThreshold)
Moves the pointer to the beginning of the first MIME part. |
|
Attachments(LifecycleManager manager,
java.io.InputStream inStream,
java.lang.String contentTypeString,
boolean fileCacheEnable,
java.lang.String attachmentRepoDir,
java.lang.String fileThreshold,
int contentLength)
Moves the pointer to the beginning of the first MIME part. |
Method Summary | |
---|---|
void |
addDataHandler(java.lang.String contentID,
javax.activation.DataHandler dataHandler)
Programatically adding an SOAP with Attachments(SwA) Attachment. |
java.lang.String[] |
getAllContentIDs()
|
java.lang.String |
getAttachmentSpecType()
|
java.util.List |
getContentIDList()
|
java.util.Set |
getContentIDSet()
|
javax.activation.DataHandler |
getDataHandler(java.lang.String blobContentID)
Checks whether the MIME part is already parsed by checking the attachments HashMap. |
java.io.InputStream |
getIncomingAttachmentsAsSingleStream()
Returns the rest of mime stream. |
IncomingAttachmentStreams |
getIncomingAttachmentStreams()
Stream based access |
LifecycleManager |
getLifecycleManager()
|
private javax.activation.DataHandler |
getNextPartDataHandler()
|
private Part |
getPart()
|
java.lang.String |
getSOAPPartContentID()
|
java.lang.String |
getSOAPPartContentType()
|
java.io.InputStream |
getSOAPPartInputStream()
|
private static int |
readToBuffer(java.io.InputStream is,
byte[] buffer)
Read bytes into the buffer until full or until the EOS |
void |
removeDataHandler(java.lang.String blobContentID)
Removes the DataHandler corresponding to the given contenID. |
protected void |
setEndOfStream(boolean value)
endOfStreamReached will be set to true if the message ended in MIME Style having "--" suffix with the last mime boundary |
void |
setLifecycleManager(LifecycleManager manager)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
javax.mail.internet.ContentType contentType
ContentType
of the MIME message
int contentLength
byte[] boundary
boundary
which separates mime parts
java.lang.String applicationType
applicationType
used to distinguish between MTOM & SWA If the message is MTOM
optimised type is application/xop+xml If the message is SWA, type is ??have to find out
java.io.PushbackInputStream pushbackInStream
pushbackInStream
stores the reference to the incoming stream A PushbackStream
has the ability to "push back" or "unread" one byte.
int PUSHBACK_SIZE
java.util.TreeMap attachmentsMap
attachmentsMap
stores the Data Handlers of the already parsed Mime Body Parts.
This ordered Map is keyed using the content-ID's.
java.util.ArrayList cids
cids
stores the content ids in the order that the attachments
occur in the message
int partIndex
partIndex
- Number of Mime parts parsed
IncomingAttachmentStreams streams
private boolean streamsRequested
boolean
Indicating if any streams have been directly requested
private boolean partsRequested
boolean
Indicating if any data handlers have been directly requested
private boolean endOfStreamReached
endOfStreamReached
flag which is to be set by MIMEBodyPartStream when MIME
message terminator is found.
private boolean noStreams
noStreams
flag which is to be set when this class is instantiated by the SwA API
to handle programatic added attachements. An InputStream with attachments is not present at
that occation.
private java.lang.String firstPartId
private boolean fileCacheEnable
private java.lang.String attachmentRepoDir
private int fileStorageThreshold
private LifecycleManager manager
protected static org.apache.commons.logging.Log log
Constructor Detail |
---|
public Attachments(LifecycleManager manager, java.io.InputStream inStream, java.lang.String contentTypeString, boolean fileCacheEnable, java.lang.String attachmentRepoDir, java.lang.String fileThreshold) throws OMException
inStream
- contentTypeString
- fileCacheEnable
- attachmentRepoDir
-
OMException
public Attachments(LifecycleManager manager, java.io.InputStream inStream, java.lang.String contentTypeString, boolean fileCacheEnable, java.lang.String attachmentRepoDir, java.lang.String fileThreshold, int contentLength) throws OMException
inStream
- contentTypeString
- fileCacheEnable
- attachmentRepoDir
- fileThreshold
- contentLength
-
OMException
public Attachments(java.io.InputStream inStream, java.lang.String contentTypeString, boolean fileCacheEnable, java.lang.String attachmentRepoDir, java.lang.String fileThreshold) throws OMException
inStream
- contentTypeString
- fileCacheEnable
- attachmentRepoDir
-
OMException
public Attachments(java.io.InputStream inStream, java.lang.String contentTypeString, boolean fileCacheEnable, java.lang.String attachmentRepoDir, java.lang.String fileThreshold, int contentLength) throws OMException
inStream
- contentTypeString
- fileCacheEnable
- attachmentRepoDir
- fileThreshold
- contentLength
-
OMException
public Attachments(java.io.InputStream inStream, java.lang.String contentTypeString) throws OMException
inStream
- contentTypeString
-
OMException
public Attachments()
Method Detail |
---|
public LifecycleManager getLifecycleManager()
public void setLifecycleManager(LifecycleManager manager)
public java.lang.String getAttachmentSpecType()
public javax.activation.DataHandler getDataHandler(java.lang.String blobContentID)
blobContentID
- (without the surrounding angle brackets and "cid:" prefix)
public void addDataHandler(java.lang.String contentID, javax.activation.DataHandler dataHandler)
contentID
- dataHandler
- public void removeDataHandler(java.lang.String blobContentID)
blobContentID
- public java.io.InputStream getSOAPPartInputStream() throws OMException
OMException
public java.lang.String getSOAPPartContentID()
public java.lang.String getSOAPPartContentType()
public IncomingAttachmentStreams getIncomingAttachmentStreams() throws java.lang.IllegalStateException
IncomingAttachmentStreams
java.lang.IllegalStateException
- if application has alreadt started using Part's directlypublic java.lang.String[] getAllContentIDs()
public java.util.Set getContentIDSet()
public java.util.List getContentIDList()
protected void setEndOfStream(boolean value)
value
- public java.io.InputStream getIncomingAttachmentsAsSingleStream() throws java.lang.IllegalStateException
java.lang.IllegalStateException
private 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...private static int readToBuffer(java.io.InputStream is, byte[] buffer) throws java.io.IOException
is
- buffer
-
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |