public static class LayerConfiguration.Builder extends Object
LayerConfiguration.| Modifier and Type | Method and Description |
|---|---|
LayerConfiguration.Builder |
addEntry(Path sourceFile,
AbsoluteUnixPath pathInContainer)
Adds an entry to the layer.
|
LayerConfiguration.Builder |
addEntry(Path sourceFile,
AbsoluteUnixPath pathInContainer,
FilePermissions permissions)
Adds an entry to the layer with the given permissions.
|
LayerConfiguration.Builder |
addEntryRecursive(Path sourceFile,
AbsoluteUnixPath pathInContainer)
Adds an entry to the layer.
|
LayerConfiguration |
build()
Returns the built
LayerConfiguration. |
LayerConfiguration.Builder |
setName(String name)
Sets a name for this layer.
|
public LayerConfiguration.Builder setName(String name)
name - the namepublic LayerConfiguration.Builder addEntry(Path sourceFile, AbsoluteUnixPath pathInContainer)
For example, addEntry(Paths.get("myfile"),
AbsoluteUnixPath.get("/path/in/container")) adds a file myfile to the container file
system at /path/in/container.
For example, addEntry(Paths.get("mydirectory"),
AbsoluteUnixPath.get("/path/in/container")) adds a directory mydirectory/ to the
container file system at /path/in/container/. This does not add the contents
of mydirectory.
sourceFile - the source file to add to the layerpathInContainer - the path in the container file system corresponding to the sourceFilepublic LayerConfiguration.Builder addEntry(Path sourceFile, AbsoluteUnixPath pathInContainer, @Nullable FilePermissions permissions)
addEntry(Path,
AbsoluteUnixPath) for more information.sourceFile - the source file to add to the layerpathInContainer - the path in the container file system corresponding to the sourceFilepermissions - the file permissions on the container. If null, then default permissions
are used (644 for files, 755 for directories)addEntry(Path, AbsoluteUnixPath)public LayerConfiguration.Builder addEntryRecursive(Path sourceFile, AbsoluteUnixPath pathInContainer) throws IOException
For example, addEntryRecursive(Paths.get("mydirectory",
AbsoluteUnixPath.get("/path/in/container")) adds mydirectory to the container file
system at /path/in/container such that mydirectory/subfile is found at /path/in/container/subfile.
sourceFile - the source file to add to the layer recursivelypathInContainer - the path in the container file system corresponding to the sourceFileIOException - if an exception occurred when recursively listing the directorypublic LayerConfiguration build()
LayerConfiguration.LayerConfigurationCopyright © 2018. All rights reserved.