Package com.priint.pubserver.util
Class FileDataHandler
- java.lang.Object
-
- javax.activation.DataHandler
-
- com.priint.pubserver.util.FileDataHandler
-
- All Implemented Interfaces:
java.awt.datatransfer.Transferable
public class FileDataHandler extends javax.activation.DataHandlerHandler for the file data
-
-
Constructor Summary
Constructors Constructor Description FileDataHandler(javax.activation.FileDataSource ds, java.io.File tmpFile)constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanclean()java.io.FilegetTmpFile()longsize()method to get the size of the temporary filestatic FileDataHandlertoFileDataHandler(javax.activation.DataHandler source)Method to convert a DataHandler to a FileDataHandler-
Methods inherited from class javax.activation.DataHandler
getAllCommands, getBean, getCommand, getContent, getContentType, getDataSource, getInputStream, getName, getOutputStream, getPreferredCommands, getTransferData, getTransferDataFlavors, isDataFlavorSupported, setCommandMap, setDataContentHandlerFactory, writeTo
-
-
-
-
Method Detail
-
getTmpFile
public java.io.File getTmpFile()
- Returns:
- temporary file
-
toFileDataHandler
public static FileDataHandler toFileDataHandler(javax.activation.DataHandler source) throws java.io.IOException
Method to convert a DataHandler to a FileDataHandler- Parameters:
source- to be converted to FileDataHandler- Returns:
- FileDataHandler
- Throws:
java.io.IOException
-
clean
public boolean clean()
- Returns:
- true if the file has been successfully deleted. False otherwise
-
size
public long size()
method to get the size of the temporary file- Returns:
- size of the temporary file. If the file is null or does not exist 0 will be returned.
-
-