Class CompressedDirectory.DockerIgnorePathMatcher

java.lang.Object
com.spotify.docker.client.CompressedDirectory.DockerIgnorePathMatcher
All Implemented Interfaces:
PathMatcher
Enclosing class:
CompressedDirectory

private static class CompressedDirectory.DockerIgnorePathMatcher extends Object implements 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 Details

    • pattern

      private final String pattern
    • matcher

      private final PathMatcher matcher
    • exclude

      private final boolean exclude
  • Constructor Details

    • DockerIgnorePathMatcher

      public DockerIgnorePathMatcher(FileSystem fileSystem, 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 Details

    • 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(Path path)
      Specified by:
      matches in interface PathMatcher
      Parameters:
      path - the path to match.
      Returns:
      true if the given path starts with the pattern or matches the pattern
      See Also:
    • toString

      public String toString()
      Overrides:
      toString in class Object