Class Tar

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

    public class Tar
    extends AbstractMultiCompress
    Creates a Tar file containing one or more files. Outputs the filename of the Tar file generated. Always uses archives with GNU long filenamesupport. The compression (gzip or bzip2) is automatically determined based on the file extension.

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


    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
        min-user-mode: Expert
     
    -name <java.lang.String> (property: name)
        The name of the actor.
        default: Tar
     
    -annotation <adams.core.base.BaseAnnotation> (property: annotations)
        The annotations to attach to this actor.
        default:
     
    -skip <boolean> (property: skip)
        If set to true, transformation is skipped and the input token is just forwarded
        as it is.
        default: false
     
    -stop-flow-on-error <boolean> (property: stopFlowOnError)
        If set to true, the flow execution at this level gets stopped in case this
        actor encounters an error; the error gets propagated; useful for critical
        actors.
        default: false
        min-user-mode: Expert
     
    -silent <boolean> (property: silent)
        If enabled, then no errors are output in the console; Note: the enclosing
        actor handler must have this enabled as well.
        default: false
        min-user-mode: Expert
     
    -output <adams.core.io.PlaceholderFile> (property: output)
        The Tar file to create.
        default: ${CWD}
     
    -strip-path <java.lang.String> (property: stripPath)
        The regular expression for stripping the path; use '.*' to remove the path
        completely; NB: uses platform-dependent slashes of the absolute path when
        applying the expression.
        default:
     
    -strip-prefix <java.lang.String> (property: stripPrefix)
        The prefix to remove from the path, case-insensitive
        default:
     
    -buffer <int> (property: bufferSize)
        The size of the buffer in bytes for the data stream.
        default: 1024
        minimum: 1
     
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Constructor Detail

      • Tar

        public Tar()
    • Method Detail

      • outputTipText

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

        protected String compress​(File[] inFiles)
        Adds all the files to archive.
        Specified by:
        compress in class AbstractMultiCompress
        Parameters:
        inFiles - the files store in the
        Returns:
        null if successful, otherwise error message