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,
java.time.Instant lastModifiedTime)
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.Builder |
addEntryRecursive(java.nio.file.Path sourceFile,
AbsoluteUnixPath pathInContainer,
java.util.function.BiFunction<java.nio.file.Path,AbsoluteUnixPath,FilePermissions> filePermissionProvider)
Adds an entry to the layer.
|
LayerConfiguration.Builder |
addEntryRecursive(java.nio.file.Path sourceFile,
AbsoluteUnixPath pathInContainer,
java.util.function.BiFunction<java.nio.file.Path,AbsoluteUnixPath,FilePermissions> filePermissionProvider,
java.util.function.BiFunction<java.nio.file.Path,AbsoluteUnixPath,java.time.Instant> lastModifiedTimeProvider)
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, 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 containeraddEntry(Path, AbsoluteUnixPath)
,
FilePermissions.DEFAULT_FILE_PERMISSIONS
,
FilePermissions.DEFAULT_FOLDER_PERMISSIONS
public LayerConfiguration.Builder addEntry(java.nio.file.Path sourceFile, AbsoluteUnixPath pathInContainer, FilePermissions permissions, java.time.Instant lastModifiedTime)
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 containerlastModifiedTime
- the file modification timestampaddEntry(Path, AbsoluteUnixPath)
,
FilePermissions.DEFAULT_FILE_PERMISSIONS
,
FilePermissions.DEFAULT_FOLDER_PERMISSIONS
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.Builder addEntryRecursive(java.nio.file.Path sourceFile, AbsoluteUnixPath pathInContainer, java.util.function.BiFunction<java.nio.file.Path,AbsoluteUnixPath,FilePermissions> filePermissionProvider) throws java.io.IOException
sourceFile
- the source file to add to the layer recursivelypathInContainer
- the path in the container file system corresponding to the sourceFile
filePermissionProvider
- a provider that takes a source path and destination path on the
container and returns the file permissions that should be set for that pathjava.io.IOException
- if an exception occurred when recursively listing the directorypublic LayerConfiguration.Builder addEntryRecursive(java.nio.file.Path sourceFile, AbsoluteUnixPath pathInContainer, java.util.function.BiFunction<java.nio.file.Path,AbsoluteUnixPath,FilePermissions> filePermissionProvider, java.util.function.BiFunction<java.nio.file.Path,AbsoluteUnixPath,java.time.Instant> lastModifiedTimeProvider) throws java.io.IOException
sourceFile
- the source file to add to the layer recursivelypathInContainer
- the path in the container file system corresponding to the sourceFile
filePermissionProvider
- a provider that takes a source path and destination path on the
container and returns the file permissions that should be set for that pathlastModifiedTimeProvider
- a provider that takes a source path and destination path on
the container and returns the file modification time that should be set for that pathjava.io.IOException
- if an exception occurred when recursively listing the directorypublic LayerConfiguration build()
LayerConfiguration
.LayerConfiguration