Class AbstractSingleCompress

    • Field Detail

      • m_RemoveInputFile

        protected boolean m_RemoveInputFile
        whether to remove the original input file.
      • m_Output

        protected PlaceholderFile m_Output
        the filename of the GZIP output.
      • m_BufferSize

        protected int m_BufferSize
        the buffer size to use.
    • Constructor Detail

      • AbstractSingleCompress

        public AbstractSingleCompress()
    • Method Detail

      • getDefaultExtension

        protected abstract String getDefaultExtension()
        Returns the default extension that the compressed archive has, e.g., ".gz" for gzipped files.
        Returns:
        the extension, including the dot
      • setRemoveInputFile

        public void setRemoveInputFile​(boolean value)
        Sets whether to remove the original input after the file has been compressed.
        Parameters:
        value - true if the input file should be removed
      • getRemoveInputFile

        public boolean getRemoveInputFile()
        Returns whether to remove the original input after the file has been compressed.
        Returns:
        true if the input file will be removed
      • removeInputFileTipText

        public String removeInputFileTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setOutput

        public void setOutput​(PlaceholderFile value)
        Sets the GZIP output filename.
        Parameters:
        value - the filename
      • getOutput

        public PlaceholderFile getOutput()
        Returns the GZIP output filename.
        Returns:
        the filename
      • outputTipText

        public abstract String outputTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setBufferSize

        public void setBufferSize​(int value)
        Sets the buffer size for the stream.
        Parameters:
        value - the size in bytes
      • getBufferSize

        public int getBufferSize()
        Returns the buffer size for the stream.
        Returns:
        the size in bytes
      • bufferSizeTipText

        public String bufferSizeTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • accepts

        public Class[] accepts()
        Returns the class that the consumer accepts.
        Returns:
        the accepted input
      • generates

        public Class[] generates()
        Returns the class of objects that it generates.
        Returns:
        the generated output
      • compress

        protected abstract String compress​(File inFile,
                                           File outFile)
        Compresses the file.
        Parameters:
        inFile - the uncompressed input file
        outFile - the compressed output file
        Returns:
        null if successfully compressed, otherwise error message
      • compress

        protected abstract String compress​(byte[] inBytes,
                                           gnu.trove.list.TByteList outBytes)
        Compresses the bytes.
        Parameters:
        inBytes - the uncompressed bytes
        outBytes - the compressed bytes
        Returns:
        null if successfully compressed, otherwise error message
      • doExecute

        protected String doExecute()
        Performs the actual transformation.
        Specified by:
        doExecute in class AbstractActor
        Returns:
        null if everything is fine, otherwise error message