java.lang.Object
gnu.mail.handler.Application
- All Implemented Interfaces:
- javax.activation.DataContentHandler
- Direct Known Subclasses:
- ApplicationOctetStream
- public abstract class Application
- extends java.lang.Object
- implements javax.activation.DataContentHandler
A JAF data content handler for the application/* family of MIME content
types.
This provides the basic behaviour for any number of byte-array-handling
subtypes which simply need to override their default constructor to provide
the correct MIME content-type and description.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
flavor
protected java.awt.datatransfer.DataFlavor flavor
- Our favorite data flavor.
Application
protected Application(java.lang.String mimeType,
java.lang.String description)
- Constructor specifying the data flavor.
getTransferDataFlavors
public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
- Returns an array of DataFlavor objects indicating the flavors the data
can be provided in.
- Specified by:
getTransferDataFlavors in interface javax.activation.DataContentHandler
getTransferData
public java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor flavor,
javax.activation.DataSource source)
throws java.awt.datatransfer.UnsupportedFlavorException,
java.io.IOException
- Returns an object which represents the data to be transferred.
The class of the object returned is defined by the representation class
of the flavor.
- Specified by:
getTransferData in interface javax.activation.DataContentHandler
getContent
public java.lang.Object getContent(javax.activation.DataSource source)
throws java.io.IOException
- Return an object representing the data in its most preferred form.
Generally this will be the form described by the first data flavor
returned by the
getTransferDataFlavors method.
- Specified by:
getContent in interface javax.activation.DataContentHandler
writeTo
public void writeTo(java.lang.Object object,
java.lang.String mimeType,
java.io.OutputStream out)
throws java.io.IOException
- Convert the object to a byte stream of the specified MIME type and
write it to the output stream.
- Specified by:
writeTo in interface javax.activation.DataContentHandler