public static class FileEntriesLayer.Builder
extends java.lang.Object
FileEntriesLayer.| Modifier and Type | Method and Description |
|---|---|
FileEntriesLayer.Builder |
addEntry(FileEntry entry)
Adds an entry to the layer.
|
FileEntriesLayer.Builder |
addEntry(java.nio.file.Path sourceFile,
AbsoluteUnixPath pathInContainer)
Adds an entry to the layer.
|
FileEntriesLayer.Builder |
addEntry(java.nio.file.Path sourceFile,
AbsoluteUnixPath pathInContainer,
FilePermissions permissions)
Adds an entry to the layer with the given permissions.
|
FileEntriesLayer.Builder |
addEntry(java.nio.file.Path sourceFile,
AbsoluteUnixPath pathInContainer,
FilePermissions permissions,
java.time.Instant modificationTime)
Adds an entry to the layer with the given permissions and file modification time.
|
FileEntriesLayer.Builder |
addEntry(java.nio.file.Path sourceFile,
AbsoluteUnixPath pathInContainer,
FilePermissions permissions,
java.time.Instant modificationTime,
java.lang.String ownership)
Adds an entry to the layer with the given permissions and file modification time.
|
FileEntriesLayer.Builder |
addEntry(java.nio.file.Path sourceFile,
AbsoluteUnixPath pathInContainer,
java.time.Instant modificationTime)
Adds an entry to the layer with the given file modification time.
|
FileEntriesLayer.Builder |
addEntryRecursive(java.nio.file.Path sourceFile,
AbsoluteUnixPath pathInContainer)
Adds an entry to the layer.
|
FileEntriesLayer.Builder |
addEntryRecursive(java.nio.file.Path sourceFile,
AbsoluteUnixPath pathInContainer,
FilePermissionsProvider filePermissionProvider)
Adds an entry to the layer.
|
FileEntriesLayer.Builder |
addEntryRecursive(java.nio.file.Path sourceFile,
AbsoluteUnixPath pathInContainer,
FilePermissionsProvider filePermissionProvider,
ModificationTimeProvider modificationTimeProvider)
Adds an entry to the layer.
|
FileEntriesLayer.Builder |
addEntryRecursive(java.nio.file.Path sourceFile,
AbsoluteUnixPath pathInContainer,
FilePermissionsProvider filePermissionProvider,
ModificationTimeProvider modificationTimeProvider,
OwnershipProvider ownershipProvider)
Adds an entry to the layer.
|
FileEntriesLayer |
build()
Returns the built
FileEntriesLayer. |
FileEntriesLayer.Builder |
setEntries(java.util.List<FileEntry> entries)
Sets entries for the layer.
|
FileEntriesLayer.Builder |
setName(java.lang.String name)
Sets a name for this layer.
|
public FileEntriesLayer.Builder setName(java.lang.String name)
name - the namepublic FileEntriesLayer.Builder setEntries(java.util.List<FileEntry> entries)
entries - file entries in the layerpublic FileEntriesLayer.Builder addEntry(FileEntry entry)
entry - the layer entry to addpublic FileEntriesLayer.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 sourceFilepublic FileEntriesLayer.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 sourceFilepermissions - the file permissions on the containeraddEntry(Path, AbsoluteUnixPath),
FilePermissions.DEFAULT_FILE_PERMISSIONS,
FilePermissions.DEFAULT_FOLDER_PERMISSIONSpublic FileEntriesLayer.Builder addEntry(java.nio.file.Path sourceFile, AbsoluteUnixPath pathInContainer, java.time.Instant modificationTime)
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 sourceFilemodificationTime - the file modification timeaddEntry(Path, AbsoluteUnixPath)public FileEntriesLayer.Builder addEntry(java.nio.file.Path sourceFile, AbsoluteUnixPath pathInContainer, FilePermissions permissions, java.time.Instant modificationTime)
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 containermodificationTime - the file modification timeaddEntry(Path, AbsoluteUnixPath),
FilePermissions.DEFAULT_FILE_PERMISSIONS,
FilePermissions.DEFAULT_FOLDER_PERMISSIONSpublic FileEntriesLayer.Builder addEntry(java.nio.file.Path sourceFile, AbsoluteUnixPath pathInContainer, FilePermissions permissions, java.time.Instant modificationTime, java.lang.String ownership)
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 containermodificationTime - the file modification timeownership - file ownership. For example, "1234", "user", ":5678", ":group", "1234:5678",
and "user:group". Note that "" (empty string), ":" (single colon), "0:", ":0" are allowed
and representative of "0:0" or "root:root", but prefer an empty string for "0:0".addEntry(Path, AbsoluteUnixPath),
FilePermissions.DEFAULT_FILE_PERMISSIONS,
FilePermissions.DEFAULT_FOLDER_PERMISSIONSpublic FileEntriesLayer.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 sourceFilejava.io.IOException - if an exception occurred when recursively listing the directorypublic FileEntriesLayer.Builder addEntryRecursive(java.nio.file.Path sourceFile, AbsoluteUnixPath pathInContainer, FilePermissionsProvider 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 sourceFilefilePermissionProvider - 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 FileEntriesLayer.Builder addEntryRecursive(java.nio.file.Path sourceFile, AbsoluteUnixPath pathInContainer, FilePermissionsProvider filePermissionProvider, ModificationTimeProvider modificationTimeProvider) throws java.io.IOException
sourceFile - the source file to add to the layer recursivelypathInContainer - the path in the container file system corresponding to the sourceFilefilePermissionProvider - a provider that takes a source path and destination path on the
container and returns the file permissions that should be set for that pathmodificationTimeProvider - 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 FileEntriesLayer.Builder addEntryRecursive(java.nio.file.Path sourceFile, AbsoluteUnixPath pathInContainer, FilePermissionsProvider filePermissionProvider, ModificationTimeProvider modificationTimeProvider, OwnershipProvider ownershipProvider) throws java.io.IOException
sourceFile - the source file to add to the layer recursivelypathInContainer - the path in the container file system corresponding to the sourceFilefilePermissionProvider - a provider that takes a source path and destination path on the
container and returns the file permissions that should be set for that pathmodificationTimeProvider - 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 pathownershipProvider - a provider that takes a source path and destination path on the
container and returns the ownership that should be set for that pathjava.io.IOException - if an exception occurred when recursively listing the directorypublic FileEntriesLayer build()
FileEntriesLayer.FileEntriesLayer