Class GUNZIP

  • All Implemented Interfaces:
    AdditionalInformationHandler, BufferSupporter, CleanUpHandler, Destroyable, GlobalInfoSupporter, LoggingLevelHandler, LoggingSupporter, OptionHandler, QuickInfoSupporter, ShallowCopySupporter<Actor>, SizeOfHandler, Stoppable, StoppableWithFeedback, VariablesInspectionHandler, VariableChangeListener, Actor, ErrorHandler, InputConsumer, OutputProducer, Serializable, Comparable

    public class GUNZIP
    extends AbstractSingleDecompress
    Decompresses an archive that was compressed with gzip. It is assumed, that the file ends with .gz. If that is not the case, an alternative filename has to be provided.
    The filename of the generated output filename is then broadcasted.

    Input/output:
    - accepts:
       java.lang.String
       java.io.File
    - generates:
       java.lang.String


    Valid options are:

    -D (property: debug)
        If set to true, scheme may output additional info to the console.
     
    -name <java.lang.String> (property: name)
        The name of the actor.
        default: GUNZIP
     
    -annotation <adams.core.base.BaseText> (property: annotations)
        The annotations to attach to this actor.
        default:
     
    -skip (property: skip)
        If set to true, transformation is skipped and the input token is just forwarded
        as it is.
     
    -use-out-dir (property: useAlternativeOutputDir)
        By default the compressed file will be uncompressed at the same location
        as the archive with the .gz extension; use this option to enabled the selection
        of a different output directory.
     
    -out-dir <adams.core.io.PlaceholderFile> (property: alternativeOutputDir)
        The alternative output directory to use.
        default: .
     
    -alt-filename <java.lang.String> (property: alternativeFilename)
        The alternative filename to use, instead of the one from the input file
        with the .gz extension removed.
        default:
     
    -buffer <int> (property: bufferSize)
        The size of the buffer in bytes for the data stream.
        default: 1024
     
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Constructor Detail

      • GUNZIP

        public GUNZIP()
    • Method Detail

      • useAlternativeOutputDirTipText

        public String useAlternativeOutputDirTipText()
        Returns the tip text for this property.
        Specified by:
        useAlternativeOutputDirTipText in class AbstractSingleDecompress
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • alternativeFilenameTipText

        public String alternativeFilenameTipText()
        Returns the tip text for this property.
        Specified by:
        alternativeFilenameTipText in class AbstractSingleDecompress
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • getDefaultExtension

        protected String getDefaultExtension()
        Returns the default extension that the compressed archive has, e.g., ".gz" for gzipped files.
        Specified by:
        getDefaultExtension in class AbstractSingleDecompress
        Returns:
        the extension, including the dot
      • decompress

        protected String decompress​(File inFile,
                                    File outFile)
        Decompresses the archive.
        Specified by:
        decompress in class AbstractSingleDecompress
        Parameters:
        inFile - the compressed archive
        outFile - the decompressed output file
        Returns:
        null if successful, otherwise error message
      • decompress

        protected String decompress​(byte[] inBytes,
                                    gnu.trove.list.TByteList outBytes)
        Decompresses the bytes.
        Specified by:
        decompress in class AbstractSingleDecompress
        Parameters:
        inBytes - the compressed bytes
        outBytes - the decompressed bytes
        Returns:
        null if successful, otherwise error message