Class IfAll

  • All Implemented Interfaces:
    PathCondition

    @Plugin(name="IfAll",
            category="Core",
            printObject=true)
    public final class IfAll
    extends java.lang.Object
    implements PathCondition
    Composite PathCondition that only accepts objects that are accepted by all component conditions. Corresponds to logical "AND".
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean accept​(java.nio.file.Path baseDir, java.nio.file.Path relativePath, java.nio.file.attribute.BasicFileAttributes attrs)
      Returns true if the specified candidate path should be deleted, false otherwise.
      static boolean accept​(PathCondition[] list, java.nio.file.Path baseDir, java.nio.file.Path relativePath, java.nio.file.attribute.BasicFileAttributes attrs)
      Returns true if all the specified conditions accept the specified path, false otherwise.
      void beforeFileTreeWalk()
      Invoked before a new file tree walk is started.
      static void beforeFileTreeWalk​(PathCondition[] nestedConditions)
      Calls beforeFileTreeWalk() on all of the specified nested conditions.
      static IfAll createAndCondition​(PathCondition... components)
      Create a Composite PathCondition whose components all need to accept before this condition accepts.
      PathCondition[] getDeleteFilters()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • accept

        public boolean accept​(java.nio.file.Path baseDir,
                              java.nio.file.Path relativePath,
                              java.nio.file.attribute.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
        Parameters:
        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
        Returns:
        whether the candidate path should be deleted
      • accept

        public static boolean accept​(PathCondition[] list,
                                     java.nio.file.Path baseDir,
                                     java.nio.file.Path relativePath,
                                     java.nio.file.attribute.BasicFileAttributes attrs)
        Returns true if all the specified conditions accept the specified path, false otherwise.
        Parameters:
        list - the array of conditions to evaluate
        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
        Returns:
        true if all the specified conditions accept the specified path, false otherwise
        Throws:
        java.lang.NullPointerException - if any of the parameters is null
      • 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
      • createAndCondition

        @PluginFactory
        public static IfAll createAndCondition​(@PluginElement("PathConditions")
                                               PathCondition... components)
        Create a Composite PathCondition whose components all need to accept before this condition accepts.
        Parameters:
        components - The component filters.
        Returns:
        A Composite PathCondition.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object