org.apache.axiom.attachments
Class ConfigurableDataHandler

java.lang.Object
  extended by javax.activation.DataHandler
      extended by org.apache.axiom.attachments.ConfigurableDataHandler
All Implemented Interfaces:
java.awt.datatransfer.Transferable

public class ConfigurableDataHandler
extends javax.activation.DataHandler

This Axiom DataHandler inplementation allows the user to set custom values for the following MIME body part headers.

Data written to the MIME part gets encoded by content-transfer-encoding specified as above

Usage is Similar to the javax.activation.DataHandler except for the setting of the above properties.

eg:

dataHandler = new ConfigurableDataHandler(new ByteArrayDataSource(byteArray));

dataHandler.setTransferEncoding("quoted-printable");

dataHandler.setContentType("image/jpg");

See Also:
DataHandler

Field Summary
private  java.lang.String contentID
           
private  java.lang.String contentType
           
private  java.lang.String transferEncoding
           
 
Constructor Summary
ConfigurableDataHandler(javax.activation.DataSource arg0)
           
ConfigurableDataHandler(java.lang.Object arg0, java.lang.String arg1)
           
ConfigurableDataHandler(java.net.URL arg0)
           
 
Method Summary
 java.lang.String getContentType()
           
 java.lang.String getTransferEncoding()
           
 void setContentType(java.lang.String contentType)
           
 void setTransferEncoding(java.lang.String transferEncoding)
           
 
Methods inherited from class javax.activation.DataHandler
getAllCommands, getBean, getCommand, getContent, getDataSource, getInputStream, getName, getOutputStream, getPreferredCommands, getTransferData, getTransferDataFlavors, isDataFlavorSupported, setCommandMap, setDataContentHandlerFactory, writeTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

transferEncoding

private java.lang.String transferEncoding

contentType

private java.lang.String contentType

contentID

private java.lang.String contentID
Constructor Detail

ConfigurableDataHandler

public ConfigurableDataHandler(javax.activation.DataSource arg0)

ConfigurableDataHandler

public ConfigurableDataHandler(java.lang.Object arg0,
                               java.lang.String arg1)

ConfigurableDataHandler

public ConfigurableDataHandler(java.net.URL arg0)
Method Detail

getContentType

public java.lang.String getContentType()
Overrides:
getContentType in class javax.activation.DataHandler

setContentType

public void setContentType(java.lang.String contentType)

getTransferEncoding

public java.lang.String getTransferEncoding()

setTransferEncoding

public void setTransferEncoding(java.lang.String transferEncoding)