public static class LayerConfiguration.Builder
extends java.lang.Object
LayerConfiguration
.Modifier and Type | Method and Description |
---|---|
LayerConfiguration.Builder |
addEntry(java.nio.file.Path sourceFile,
AbsoluteUnixPath pathInContainer)
Adds an entry to the layer.
|
LayerConfiguration.Builder |
addEntry(java.nio.file.Path sourceFile,
AbsoluteUnixPath pathInContainer,
FilePermissions permissions)
Adds an entry to the layer with the given permissions.
|
LayerConfiguration.Builder |
addEntry(java.nio.file.Path sourceFile,
AbsoluteUnixPath pathInContainer,
FilePermissions permissions,
long lastModified)
Adds an entry to the layer with the given permissions.
|
LayerConfiguration.Builder |
addEntryRecursive(java.nio.file.Path sourceFile,
AbsoluteUnixPath pathInContainer)
Adds an entry to the layer.
|
LayerConfiguration |
build()
Returns the built
LayerConfiguration . |
LayerConfiguration.Builder |
setName(java.lang.String name)
Sets a name for this layer.
|
public LayerConfiguration.Builder setName(java.lang.String name)
name
- the namepublic LayerConfiguration.Builder addEntry(java.nio.file.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 sourceFile
public LayerConfiguration.Builder addEntry(java.nio.file.Path sourceFile, AbsoluteUnixPath pathInContainer, @Nullable FilePermissions permissions, long lastModified)
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 sourceFile
permissions
- the file permissions on the container. If null, then default permissions
are used (644 for files, 755 for directories)lastModified
- the modification time of the fileaddEntry(Path, AbsoluteUnixPath)
public LayerConfiguration.Builder addEntry(java.nio.file.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 sourceFile
permissions
- 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(java.nio.file.Path sourceFile, AbsoluteUnixPath pathInContainer) throws java.io.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 sourceFile
java.io.IOException
- if an exception occurred when recursively listing the directorypublic LayerConfiguration build()
LayerConfiguration
.LayerConfiguration