Class DeleteFile

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

    public class DeleteFile
    extends AbstractStandalone
    Deletes the files that match the regular expression below the specified directory.

    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -name <java.lang.String> (property: name)
        The name of the actor.
        default: DeleteFile
     
    -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
     
    -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
     
    -dir <adams.core.io.PlaceholderDirectory> (property: directory)
        The directory to delete the files in.
        default: ${CWD}
     
    -regexp <adams.core.base.BaseRegExp> (property: regExp)
        The regular expression that the files must match (empty string matches all
        ).
        default: .*
        more: https://docs.oracle.com/javase/tutorial/essential/regex/
        https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html
     
    -recursive <boolean> (property: recursive)
        Whether to search recursively or not.
        default: false
     
    -max-depth <int> (property: maxDepth)
        The maximum depth to search in recursive mode (1 = only watch directory,
        -1 = infinite).
        default: -1
     
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Constructor Detail

      • DeleteFile

        public DeleteFile()
    • Method Detail

      • setDirectory

        public void setDirectory​(PlaceholderDirectory value)
        Sets the directory to delete the files in.
        Parameters:
        value - the directory
      • getDirectory

        public PlaceholderDirectory getDirectory()
        Returns the directory to delete the files in.
        Returns:
        the directory.
      • directoryTipText

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

        public void setRegExp​(BaseRegExp value)
        Sets the regular expression for the files.
        Parameters:
        value - the regular expression
      • regExpTipText

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

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

        public void setMaxDepth​(int value)
        Sets the maximum depth to search (in recursive mode). 1 = only watch directory, -1 = infinite.
        Parameters:
        value - the maximum number of directory levels to traverse
      • getMaxDepth

        public int getMaxDepth()
        Returns the maximum depth to search (in recursive mode). 1 = only watch directory, -1 = infinite.
        Returns:
        the maximum number of directory levels to traverse
      • maxDepthTipText

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

        protected String doExecute()
        Executes the flow item.
        Specified by:
        doExecute in class AbstractActor
        Returns:
        null if everything is fine, otherwise error message