class PartDataHandler extends javax.activation.DataHandler implements DataHandlerExt
DataHandler implementation for MIME parts read from a stream.| Modifier and Type | Field and Description |
|---|---|
private javax.activation.DataSource |
dataSource |
private PartImpl |
part |
| Constructor and Description |
|---|
PartDataHandler(PartImpl part) |
| Modifier and Type | Method and Description |
|---|---|
void |
deleteWhenReadOnce() |
javax.activation.DataSource |
getDataSource() |
void |
purgeDataSource()
This method will give users an option to trigger a purge
on temporary attachment files.
|
java.io.InputStream |
readOnce()
Get an
InputStream that consumes the content of this data handler. |
void |
writeTo(java.io.OutputStream os) |
private final PartImpl part
private javax.activation.DataSource dataSource
public PartDataHandler(PartImpl part)
public javax.activation.DataSource getDataSource()
getDataSource in class javax.activation.DataHandlerpublic void writeTo(java.io.OutputStream os)
throws java.io.IOException
writeTo in class javax.activation.DataHandlerjava.io.IOExceptionpublic java.io.InputStream readOnce()
throws java.io.IOException
DataHandlerExtInputStream that consumes the content of this data handler. This method is
similar to DataHandler.getInputStream() except that it can be invoked only once. If
the content has not been buffered yet, then the implementation may choose to enable streaming
of the content.
The implementation ensures that after the returned input steam is consumed, the data handler
will be in the same state as after a call to DataHandlerExt.purgeDataSource().
readOnce in interface DataHandlerExtnulljava.io.IOException - if an error occurspublic void purgeDataSource()
throws java.io.IOException
DataHandlerExtpurgeDataSource in interface DataHandlerExtjava.io.IOExceptionpublic void deleteWhenReadOnce()
throws java.io.IOException
deleteWhenReadOnce in interface DataHandlerExtjava.io.IOException