org.apache.axiom.attachments.impl
Class PartOnFile
java.lang.Object
org.apache.axiom.attachments.impl.AbstractPart
org.apache.axiom.attachments.impl.PartOnFile
- All Implemented Interfaces:
- Part
public class PartOnFile
- extends AbstractPart
PartOnFile stores that attachment in a file.
This implementation is used for very large attachments to reduce
the in-memory footprint.
The PartOnFile object is created by the PartFactory
- See Also:
org.apache.axiom.attachments.impl.PartFactory.
Constructor Summary |
PartOnFile(LifecycleManager manager,
java.util.Hashtable headers,
java.io.InputStream is1,
java.io.InputStream is2,
java.lang.String attachmentDir)
Create a PartOnFile from the specified InputStream |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
fileAccessor
FileAccessor fileAccessor
manager
LifecycleManager manager
PartOnFile
PartOnFile(LifecycleManager manager,
java.util.Hashtable headers,
java.io.InputStream is1,
java.io.InputStream is2,
java.lang.String attachmentDir)
throws java.io.IOException
- Create a PartOnFile from the specified InputStream
- Parameters:
headers
- Hashtable of javax.mail.Headersin1
- InputStream containing datain2
- InputStream containing dataattachmentDir
- String
- Throws:
java.io.IOException
getDataHandler
public javax.activation.DataHandler getDataHandler()
throws javax.mail.MessagingException
- Specified by:
getDataHandler
in interface Part
- Specified by:
getDataHandler
in class AbstractPart
- Returns:
- DataHandler representing this part
- Throws:
javax.mail.MessagingException
getFileName
public java.lang.String getFileName()
throws javax.mail.MessagingException
- Description copied from interface:
Part
- The part may be backed by a file. If that is the case,
this method returns the file name.
- Specified by:
getFileName
in interface Part
- Specified by:
getFileName
in class AbstractPart
- Returns:
-
- Throws:
javax.mail.MessagingException
getInputStream
public java.io.InputStream getInputStream()
throws java.io.IOException,
javax.mail.MessagingException
- Specified by:
getInputStream
in interface Part
- Specified by:
getInputStream
in class AbstractPart
- Returns:
- Get the part data as an input stream
- Throws:
java.io.IOException
javax.mail.MessagingException
getSize
public long getSize()
- Specified by:
getSize
in interface Part
- Specified by:
getSize
in class AbstractPart
- Returns:
- size