Class ScriptCondition

    • Constructor Detail

      • ScriptCondition

        public ScriptCondition​(AbstractScript script,
                               Configuration configuration)
        Constructs a new ScriptCondition.
        Parameters:
        script - the script that can select files to delete
        configuration - configuration containing the StrSubstitutor passed to the script
    • Method Detail

      • createCondition

        @PluginFactory
        public static ScriptCondition createCondition​(@PluginElement("Script")
                                                      AbstractScript script,
                                                      @PluginConfiguration
                                                      Configuration configuration)
        Creates the ScriptCondition.
        Parameters:
        script - The script to run. This may be a Script, a ScriptFile or a ScriptRef. The script must return a List<PathWithAttributes>. When the script is executed, it is provided the following bindings:
        • basePath - the directory from where the Delete action started scanning for files to delete. Can be used to relativize the paths in the pathList.
        • pathList - a java.util.List containing PathWithAttribute objects. (The script is free to modify and return this list.)
        • substitutor - a StrSubstitutor that can be used to look up variables embedded in the base dir or other properties
        • statusLogger - the StatusLogger that can be used to log events during script execution
        • any properties declared in the configuration
        configuration - the configuration
        Returns:
        A ScriptCondition.