Class FileDataHandler

  • All Implemented Interfaces:
    java.awt.datatransfer.Transferable

    public class FileDataHandler
    extends javax.activation.DataHandler
    Handler 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
      boolean clean()  
      java.io.File getTmpFile()  
      long size()
      method to get the size of the temporary file
      static FileDataHandler toFileDataHandler​(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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FileDataHandler

        public FileDataHandler​(javax.activation.FileDataSource ds,
                               java.io.File tmpFile)
        constructor
        Parameters:
        ds - data source
        tmpFile - temporary file
    • 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.