Package com.spotify.docker.client
Class CompressedDirectory.Visitor
- All Implemented Interfaces:
FileVisitor<Path>
- Enclosing class:
CompressedDirectory
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final com.google.common.collect.ImmutableList<CompressedDirectory.DockerIgnorePathMatcher> private final Pathprivate final org.apache.commons.compress.archivers.tar.TarArchiveOutputStream -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateVisitor(Path root, com.google.common.collect.ImmutableList<CompressedDirectory.DockerIgnorePathMatcher> ignoreMatchers, org.apache.commons.compress.archivers.tar.TarArchiveOutputStream tarStream) -
Method Summary
Modifier and TypeMethodDescriptionprivate static booleanexclude(com.google.common.collect.ImmutableList<CompressedDirectory.DockerIgnorePathMatcher> matchers, Path path) Checks if any of the givenCompressedDirectory.DockerIgnorePathMatchermatches the givenpath.private static intgetFileMode(Path file) private static intgetModeFromPermissions(boolean read, boolean write, boolean execute) private static intgetPosixFileMode(Path file) private static booleanpreVisitDirectory(Path dir, BasicFileAttributes attrs) visitFile(Path file, BasicFileAttributes attrs) Methods inherited from class java.nio.file.SimpleFileVisitor
postVisitDirectory, visitFileFailed
-
Field Details
-
root
-
ignoreMatchers
private final com.google.common.collect.ImmutableList<CompressedDirectory.DockerIgnorePathMatcher> ignoreMatchers -
tarStream
private final org.apache.commons.compress.archivers.tar.TarArchiveOutputStream tarStream
-
-
Constructor Details
-
Visitor
private Visitor(Path root, com.google.common.collect.ImmutableList<CompressedDirectory.DockerIgnorePathMatcher> ignoreMatchers, org.apache.commons.compress.archivers.tar.TarArchiveOutputStream tarStream)
-
-
Method Details
-
preVisitDirectory
- Specified by:
preVisitDirectoryin interfaceFileVisitor<Path>- Overrides:
preVisitDirectoryin classSimpleFileVisitor<Path>- Throws:
IOException
-
visitFile
- Specified by:
visitFilein interfaceFileVisitor<Path>- Overrides:
visitFilein classSimpleFileVisitor<Path>- Throws:
IOException
-
exclude
private static boolean exclude(com.google.common.collect.ImmutableList<CompressedDirectory.DockerIgnorePathMatcher> matchers, Path path) Checks if any of the givenCompressedDirectory.DockerIgnorePathMatchermatches the givenpath.- Parameters:
matchers- theCompressedDirectory.DockerIgnorePathMatcherto usepath- the path to match- Returns:
trueif the given path should be excluded,falseotherwise
-
getFileMode
- Throws:
IOException
-
isPosixComplantFs
private static boolean isPosixComplantFs() -
getPosixFileMode
- Throws:
IOException
-
getModeFromPermissions
private static int getModeFromPermissions(boolean read, boolean write, boolean execute)
-