Class FileConversion


  • public class FileConversion
    extends Conversion
    Represents the state of a running file conversion.
    • Constructor Summary

      Constructors 
      Constructor Description
      FileConversion​(AdapterOutputType outputType, java.lang.String filename, long userdata)
      Creates a new conversion object for the conversion of a file on the local file system to a specified target format.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Used by the Connectivity Framework to close this Conversion object.
      java.io.InputStream getInputStream()
      Returns an I/O stream from which the file data can be read.
      boolean isLocalFile()
      Returns true if the file to convert resides on the local file system.
      int read​(byte[] data, int offset, int count)
      Read file data via delegate method provided by the calling program.
      • Methods inherited from class java.lang.Object

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

      • FileConversion

        public FileConversion​(AdapterOutputType outputType,
                              java.lang.String filename,
                              long userdata)
        Creates a new conversion object for the conversion of a file on the local file system to a specified target format.
        Parameters:
        outputType - The format to convert the file to
        filename - The (fully qualified) name of the file to convert
        userdata - Opaque user data (usually a pointer) provided via JNI.
    • Method Detail

      • close

        public void close()
        Description copied from class: Conversion
        Used by the Connectivity Framework to close this Conversion object. This method is invoked by the Connectivity Framework. A File Filter adapter implementation should not use it.
        Overrides:
        close in class Conversion
      • isLocalFile

        public boolean isLocalFile()
        Description copied from class: Conversion
        Returns true if the file to convert resides on the local file system.
        Specified by:
        isLocalFile in class Conversion
      • read

        public int read​(byte[] data,
                        int offset,
                        int count)
                 throws java.lang.Exception
        Description copied from class: Conversion
        Read file data via delegate method provided by the calling program.

        You should use either this method to access file data or the input stream. Do not use both; once you use the input stream this method may no longer return any data.

        Specified by:
        read in class Conversion
        Parameters:
        data - Byte array to receive data
        offset - Offset into the byte array at which data starts getting written
        count - The number of bytes to read
        Returns:
        The number of bytes actually read
        Throws:
        java.lang.Exception
      • getInputStream

        public java.io.InputStream getInputStream()
                                           throws java.lang.Exception
        Description copied from class: Conversion
        Returns an I/O stream from which the file data can be read.

        You should use either this method to access file data or the read method. Do not use both; once you use the input stream, the read method may no longer return any data.

        Specified by:
        getInputStream in class Conversion
        Returns:
        A new InputStream object
        Throws:
        java.lang.Exception - IOException if an input stream could not be created