class PartContentOnFile extends PartContent
PartContentFactory| Modifier and Type | Field and Description |
|---|---|
private FileAccessor |
fileAccessor |
private LifecycleManager |
manager |
| Constructor and Description |
|---|
PartContentOnFile(LifecycleManager manager,
java.io.InputStream is1,
java.io.InputStream is2,
java.lang.String attachmentDir)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
(package private) void |
destroy()
Release all resources used to store the content of the MIME part.
|
(package private) javax.activation.DataSource |
getDataSource(java.lang.String contentType)
Get a
DataSource implementation specific for this buffering strategy, if supported. |
(package private) java.io.InputStream |
getInputStream()
Get an
InputStream representing the buffered MIME part content. |
(package private) long |
getSize()
Get the size of the MIME part, more precisely the number of bytes in the decoded content of
the MIME part.
|
(package private) void |
writeTo(java.io.OutputStream out)
Write the buffered MIME part content to the given output stream.
|
private final FileAccessor fileAccessor
private final LifecycleManager manager
PartContentOnFile(LifecycleManager manager, java.io.InputStream is1, java.io.InputStream is2, java.lang.String attachmentDir) throws java.io.IOException
manager - the lifecycle manager that will be used for managing temporary files created by
this instancein1 - InputStream containing datain2 - InputStream containing dataattachmentDir - the file system location where temporary files are created; this value will be
used in calls to LifecycleManager.create(String)java.io.IOExceptionjava.io.InputStream getInputStream()
throws java.io.IOException
PartContentInputStream representing the buffered MIME part content. Note that a new
InputStream object must be returned each time this method is called, and the stream
must be positioned at the beginning of the data.getInputStream in class PartContentjava.io.IOException - if an error occurs while accessing the buffered contentjavax.activation.DataSource getDataSource(java.lang.String contentType)
PartContentDataSource implementation specific for this buffering strategy, if supported.
If no DataSource is returned, then a default implementation will be used. If a
DataSource is returned, it should implement SizeAwareDataSource.getDataSource in class PartContentcontentType - the content type for the DataSource, which must be returned by
DataSource.getContentType()DataSource implementation or null if a default
DataSource implementation should be usedvoid writeTo(java.io.OutputStream out)
throws java.io.IOException
PartContentwriteTo in class PartContentout - the output stream to write the content tojava.io.IOException - if an I/O error occurs (either while reading the buffered content or while
writing to the output stream)long getSize()
PartContentgetSize in class PartContentvoid destroy()
throws java.io.IOException
PartContentdestroy in class PartContentjava.io.IOException - if an I/O error occurs