javax.activation
Class DataHandler
java.lang.Object
javax.activation.DataHandler
- All Implemented Interfaces:
- Transferable
public class DataHandler
- extends Object
- implements Transferable
- Version:
- $Rev: 376811 $ $Date: 2006-02-10 11:40:13 -0800 (Fri, 10 Feb 2006) $
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DataHandler
public DataHandler(DataSource ds)
DataHandler
public DataHandler(Object data,
String type)
DataHandler
public DataHandler(URL url)
getDataSource
public DataSource getDataSource()
getName
public String getName()
getContentType
public String getContentType()
getInputStream
public InputStream getInputStream()
throws IOException
- Throws:
IOException
writeTo
public void writeTo(OutputStream os)
throws IOException
- Throws:
IOException
getOutputStream
public OutputStream getOutputStream()
throws IOException
- Throws:
IOException
getTransferDataFlavors
public DataFlavor[] getTransferDataFlavors()
- Specified by:
getTransferDataFlavors
in interface Transferable
isDataFlavorSupported
public boolean isDataFlavorSupported(DataFlavor flavor)
- Specified by:
isDataFlavorSupported
in interface Transferable
getTransferData
public Object getTransferData(DataFlavor flavor)
throws UnsupportedFlavorException,
IOException
- Specified by:
getTransferData
in interface Transferable
- Throws:
UnsupportedFlavorException
IOException
getPreferredCommands
public CommandInfo[] getPreferredCommands()
getAllCommands
public CommandInfo[] getAllCommands()
getCommand
public CommandInfo getCommand(String cmdName)
getContent
public Object getContent()
throws IOException
- Throws:
IOException
getBean
public Object getBean(CommandInfo cmdinfo)
setCommandMap
public void setCommandMap(CommandMap commandMap)
setDataContentHandlerFactory
public static void setDataContentHandlerFactory(DataContentHandlerFactory newFactory)
- Set the DataContentHandlerFactory to use.
If this method has already been called then an Error is raised.
- Parameters:
newFactory
- the new factory
- Throws:
SecurityException
- if the caller does not have "SetFactory" RuntimePermission
Copyright © 2006 Apache Software Foundation. All Rights Reserved.