Class CompressedDirectory.DockerIgnorePathMatcher

  • All Implemented Interfaces:
    java.nio.file.PathMatcher
    Enclosing class:
    CompressedDirectory

    private static class CompressedDirectory.DockerIgnorePathMatcher
    extends java.lang.Object
    implements java.nio.file.PathMatcher
    A decorator for the PathMatcher with a type to determine if it is an exclusion pattern or an exclude to an aforementioned exclusion. See https://docs.docker.com/engine/reference/builder/#dockerignore-file
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean exclude  
      private java.nio.file.PathMatcher matcher  
      private java.lang.String pattern  
    • Constructor Summary

      Constructors 
      Constructor Description
      DockerIgnorePathMatcher​(java.nio.file.FileSystem fileSystem, java.lang.String pattern, boolean exclude)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isExclude()  
      boolean matches​(java.nio.file.Path path)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • pattern

        private final java.lang.String pattern
      • matcher

        private final java.nio.file.PathMatcher matcher
      • exclude

        private final boolean exclude
    • Constructor Detail

      • DockerIgnorePathMatcher

        public DockerIgnorePathMatcher​(java.nio.file.FileSystem fileSystem,
                                       java.lang.String pattern,
                                       boolean exclude)
        Constructor.
        Parameters:
        fileSystem - the current FileSystem
        pattern - the exclusion or inclusion pattern
        exclude - flag to indicate if the given pattern is an exclusion ( true) or if it is an inclusion (false).
    • Method Detail

      • isExclude

        public boolean isExclude()
        Returns:
        true if the given pattern is an exclusion, false if it is an exclude to an exclusion.
      • matches

        public boolean matches​(java.nio.file.Path path)
        Specified by:
        matches in interface java.nio.file.PathMatcher
        Parameters:
        path - the path to match.
        Returns:
        true if the given path starts with the pattern or matches the pattern
        See Also:
        Path.startsWith(String), PathMatcher.matches(Path)
      • toString

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