Class IfAccumulatedFileCount

All Implemented Interfaces:

@Plugin(name="IfAccumulatedFileCount", category="Core", printObject=true) public final class IfAccumulatedFileCount extends Object implements PathCondition
PathCondition that accepts paths after some count threshold is exceeded during the file tree walk.
  • Method Details

    • getThresholdCount

      public int getThresholdCount()
    • getNestedConditions

      public List<PathCondition> getNestedConditions()
    • accept

      public boolean accept(Path basePath, Path relativePath, BasicFileAttributes attrs)
      Description copied from interface: PathCondition
      Returns true if the specified candidate path should be deleted, false otherwise.
      Specified by:
      accept in interface PathCondition
      basePath - the directory from where to start scanning for deletion candidate files
      relativePath - the candidate for deletion. This path is relative to the baseDir.
      attrs - attributes of the candidate path
      whether the candidate path should be deleted
    • beforeFileTreeWalk

      public void beforeFileTreeWalk()
      Description copied from interface: PathCondition
      Invoked before a new file tree walk is started. Stateful PathConditions can reset their state when this method is called.
      Specified by:
      beforeFileTreeWalk in interface PathCondition
    • createFileCountCondition

      @PluginFactory public static IfAccumulatedFileCount createFileCountCondition(@PluginAttribute(value="exceeds",defaultInt=2147483647) int threshold, @PluginElement("PathConditions") PathCondition... nestedConditions)
      Create an IfAccumulatedFileCount condition.
      threshold - The threshold count from which files will be deleted.
      An IfAccumulatedFileCount condition.
    • toString

      public String toString()
      toString in class Object