Class PathWatcher.Config

  • All Implemented Interfaces:
    java.util.function.Predicate<java.nio.file.Path>
    Enclosing class:
    PathWatcher

    @Deprecated(since="2021-05-27")
    public static class PathWatcher.Config
    extends java.lang.Object
    implements java.util.function.Predicate<java.nio.file.Path>
    Deprecated.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int UNLIMITED_DEPTH
      Deprecated.
       
    • Constructor Summary

      Constructors 
      Constructor Description
      Config​(java.nio.file.Path path)
      Deprecated.
       
      Config​(java.nio.file.Path path, PathWatcher.Config parent)
      Deprecated.
       
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void addExclude​(java.lang.String syntaxAndPattern)
      Deprecated.
      Add an exclude PathMatcher.
      void addExclude​(java.nio.file.PathMatcher matcher)
      Deprecated.
      Add an exclude PathMatcher
      void addExcludeGlobRelative​(java.lang.String pattern)
      Deprecated.
      Add a glob: syntax pattern exclude reference in a directory relative, os neutral, pattern.
      void addExcludeHidden()
      Deprecated.
      Exclude hidden files and hidden directories
      void addExcludes​(java.util.List<java.lang.String> syntaxAndPatterns)
      Deprecated.
      Add multiple exclude PathMatchers
      void addInclude​(java.lang.String syntaxAndPattern)
      Deprecated.
      Add an include PathMatcher
      void addInclude​(java.nio.file.PathMatcher matcher)
      Deprecated.
      Add an include PathMatcher
      void addIncludeGlobRelative​(java.lang.String pattern)
      Deprecated.
      Add a glob: syntax pattern reference in a directory relative, os neutral, pattern.
      void addIncludes​(java.util.List<java.lang.String> syntaxAndPatterns)
      Deprecated.
      Add multiple include PathMatchers
      PathWatcher.Config asSubConfig​(java.nio.file.Path dir)
      Deprecated.
      Build a new config from a this configuration.
      PathWatcher.Config getParent()
      Deprecated.
       
      java.nio.file.Path getPath()
      Deprecated.
       
      int getRecurseDepth()
      Deprecated.
       
      boolean isHidden​(java.nio.file.Path path)
      Deprecated.
       
      boolean isPaused​(long now)
      Deprecated.
       
      boolean isRecurseDepthUnlimited()
      Deprecated.
       
      java.nio.file.Path resolve​(java.nio.file.Path path)
      Deprecated.
       
      void setPauseUntil​(long time)
      Deprecated.
       
      void setRecurseDepth​(int depth)
      Deprecated.
      Set the recurse depth for the directory scanning.
      boolean test​(java.nio.file.Path path)
      Deprecated.
       
      java.lang.String toShortPath​(java.nio.file.Path path)
      Deprecated.
       
      java.lang.String toString()
      Deprecated.
       
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.function.Predicate

        and, negate, or
    • Field Detail

    • Constructor Detail

      • Config

        public Config​(java.nio.file.Path path)
        Deprecated.
      • Config

        public Config​(java.nio.file.Path path,
                      PathWatcher.Config parent)
        Deprecated.
    • Method Detail

      • setPauseUntil

        public void setPauseUntil​(long time)
        Deprecated.
      • isPaused

        public boolean isPaused​(long now)
        Deprecated.
      • addExclude

        public void addExclude​(java.nio.file.PathMatcher matcher)
        Deprecated.
        Add an exclude PathMatcher
        Parameters:
        matcher - the path matcher for this exclude
      • addExclude

        public void addExclude​(java.lang.String syntaxAndPattern)
        Deprecated.
        Add an exclude PathMatcher.

        Note: this pattern is FileSystem specific (so use "/" for Linux and OSX, and "\\" for Windows)

        Parameters:
        syntaxAndPattern - the PathMatcher syntax and pattern to use
        See Also:
        for detail on syntax and pattern
      • addExcludeGlobRelative

        public void addExcludeGlobRelative​(java.lang.String pattern)
        Deprecated.
        Add a glob: syntax pattern exclude reference in a directory relative, os neutral, pattern.
            On Linux:
            Config config = new Config(Path("/home/user/example"));
            config.addExcludeGlobRelative("*.war") => "glob:/home/user/example/*.war"
        
            On Windows
            Config config = new Config(Path("D:/code/examples"));
            config.addExcludeGlobRelative("*.war") => "glob:D:\\code\\examples\\*.war"
        
         
        Parameters:
        pattern - the pattern, in unixy format, relative to config.dir
      • addExcludeHidden

        public void addExcludeHidden()
        Deprecated.
        Exclude hidden files and hidden directories
      • addExcludes

        public void addExcludes​(java.util.List<java.lang.String> syntaxAndPatterns)
        Deprecated.
        Add multiple exclude PathMatchers
        Parameters:
        syntaxAndPatterns - the list of PathMatcher syntax and patterns to use
        See Also:
        for detail on syntax and pattern
      • addInclude

        public void addInclude​(java.nio.file.PathMatcher matcher)
        Deprecated.
        Add an include PathMatcher
        Parameters:
        matcher - the path matcher for this include
      • addInclude

        public void addInclude​(java.lang.String syntaxAndPattern)
        Deprecated.
        Add an include PathMatcher
        Parameters:
        syntaxAndPattern - the PathMatcher syntax and pattern to use
        See Also:
        for detail on syntax and pattern
      • addIncludeGlobRelative

        public void addIncludeGlobRelative​(java.lang.String pattern)
        Deprecated.
        Add a glob: syntax pattern reference in a directory relative, os neutral, pattern.
            On Linux:
            Config config = new Config(Path("/home/user/example"));
            config.addIncludeGlobRelative("*.war") => "glob:/home/user/example/*.war"
        
            On Windows
            Config config = new Config(Path("D:/code/examples"));
            config.addIncludeGlobRelative("*.war") => "glob:D:\\code\\examples\\*.war"
        
         
        Parameters:
        pattern - the pattern, in unixy format, relative to config.dir
      • addIncludes

        public void addIncludes​(java.util.List<java.lang.String> syntaxAndPatterns)
        Deprecated.
        Add multiple include PathMatchers
        Parameters:
        syntaxAndPatterns - the list of PathMatcher syntax and patterns to use
        See Also:
        for detail on syntax and pattern
      • asSubConfig

        public PathWatcher.Config asSubConfig​(java.nio.file.Path dir)
        Deprecated.
        Build a new config from a this configuration.

        Useful for working with sub-directories that also need to be watched.

        Parameters:
        dir - the directory to build new Config from (using this config as source of includes/excludes)
        Returns:
        the new Config
      • getRecurseDepth

        public int getRecurseDepth()
        Deprecated.
      • isRecurseDepthUnlimited

        public boolean isRecurseDepthUnlimited()
        Deprecated.
      • getPath

        public java.nio.file.Path getPath()
        Deprecated.
      • resolve

        public java.nio.file.Path resolve​(java.nio.file.Path path)
        Deprecated.
      • test

        public boolean test​(java.nio.file.Path path)
        Deprecated.
        Specified by:
        test in interface java.util.function.Predicate<java.nio.file.Path>
      • setRecurseDepth

        public void setRecurseDepth​(int depth)
        Deprecated.
        Set the recurse depth for the directory scanning.

        -999 indicates arbitrarily deep recursion, 0 indicates no recursion, 1 is only one directory deep, and so on.

        Parameters:
        depth - the number of directories deep to recurse
      • isHidden

        public boolean isHidden​(java.nio.file.Path path)
        Deprecated.
      • toShortPath

        public java.lang.String toShortPath​(java.nio.file.Path path)
        Deprecated.
      • toString

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