All Known Implementing Classes:
IfAccumulatedFileCount, IfAccumulatedFileSize, IfAll, IfAny, IfFileName, IfLastModified, IfNot

public interface PathCondition
Filter that accepts or rejects a candidate Path for deletion.
  • Field Details


      static final PathCondition[] EMPTY_ARRAY
      The empty array.
  • Method Details

    • copy

      static PathCondition[] copy(PathCondition... source)
      Copies the given input.
      source - What to copy
      a copy, never null.
    • beforeFileTreeWalk

      void beforeFileTreeWalk()
      Invoked before a new file tree walk is started. Stateful PathConditions can reset their state when this method is called.
    • accept

      boolean accept(Path baseDir, Path relativePath, BasicFileAttributes attrs)
      Returns true if the specified candidate path should be deleted, false otherwise.
      baseDir - 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