class CompressedDirectory extends Object implements Closeable
| Modifier and Type | Class and Description |
|---|---|
private static class |
CompressedDirectory.DockerIgnorePathMatcher
A decorator for the
PathMatcher with a type to determine if it is an exclusion pattern
or an exclude to an aforementioned exclusion. |
private static class |
CompressedDirectory.Visitor |
| Modifier and Type | Field and Description |
|---|---|
private static int |
DEFAULT_FILE_MODE
Default mode to be applied to tar file entries if detailed Posix-compliant mode cannot be
obtained.
|
private Path |
file |
private static org.slf4j.Logger |
log |
private static String |
POSIX_FILE_VIEW
Identifier used to indicate the OS supports a Posix compliant view of the file system.
|
| Modifier | Constructor and Description |
|---|---|
private |
CompressedDirectory(Path file) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
static CompressedDirectory |
create(Path directory)
This method creates a gzip tarball of the specified directory.
|
private static String |
createPattern(String line) |
Path |
file()
The file for the created compressed directory archive.
|
private static String |
getNotSeparatorPattern(String separator) |
(package private) static PathMatcher |
goPathMatcher(FileSystem fs,
String pattern) |
(package private) static com.google.common.collect.ImmutableList<CompressedDirectory.DockerIgnorePathMatcher> |
parseDockerIgnore(Path dockerIgnorePath) |
private static final org.slf4j.Logger log
private static final int DEFAULT_FILE_MODE
private static final String POSIX_FILE_VIEW
private final Path file
private CompressedDirectory(Path file)
public Path file()
public static CompressedDirectory create(Path directory) throws IOException
Files.createTempFile(String, String, java.nio.file.attribute.FileAttribute[]) method. The
returned object is auto-closeable, and upon closing it, the archive file will be deleted.directory - the directory to compressIOException - if the compressed directory could not be created.public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionstatic com.google.common.collect.ImmutableList<CompressedDirectory.DockerIgnorePathMatcher> parseDockerIgnore(Path dockerIgnorePath) throws IOException
IOExceptionstatic PathMatcher goPathMatcher(FileSystem fs, String pattern)
Copyright © 2016. All rights reserved.