@Immutable
public class FileEntry
extends java.lang.Object
This class is immutable and thread-safe.
| Constructor and Description |
|---|
FileEntry(java.nio.file.Path sourceFile,
AbsoluteUnixPath extractionPath,
FilePermissions permissions,
java.time.Instant modificationTime)
Instantiates with a source file and the path to place the source file in the container file
system.
|
FileEntry(java.nio.file.Path sourceFile,
AbsoluteUnixPath extractionPath,
FilePermissions permissions,
java.time.Instant modificationTime,
java.lang.String ownership)
Instantiates with a source file and the path to place the source file in the container file
system.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object other) |
AbsoluteUnixPath |
getExtractionPath()
Gets the extraction path.
|
java.time.Instant |
getModificationTime()
Returns the modification time of the file in the entry.
|
java.lang.String |
getOwnership()
Gets the file ownership on the container.
|
FilePermissions |
getPermissions()
Gets the file permissions on the container.
|
java.nio.file.Path |
getSourceFile()
Gets the source file.
|
int |
hashCode() |
public FileEntry(java.nio.file.Path sourceFile,
AbsoluteUnixPath extractionPath,
FilePermissions permissions,
java.time.Instant modificationTime)
For example, new FileEntry(Paths.get("HelloWorld.class"),
AbsoluteUnixPath.get("/app/classes/HelloWorld.class")) adds a file HelloWorld.class to
the container file system at /app/classes/HelloWorld.class.
For example, new FileEntry(Paths.get("com"),
AbsoluteUnixPath.get("/app/classes/com")) adds a directory to the container file system at
/app/classes/com. This does not add the contents of com/.
Note that:
FileEntry.
sourceFile - the source file to add to the layerextractionPath - the path in the container file system corresponding to the sourceFilepermissions - the file permissions on the containermodificationTime - the file modification timepublic FileEntry(java.nio.file.Path sourceFile,
AbsoluteUnixPath extractionPath,
FilePermissions permissions,
java.time.Instant modificationTime,
java.lang.String ownership)
FileEntry(Path, AbsoluteUnixPath, FilePermissions, Instant) for more
information.sourceFile - the source file to add to the layerextractionPath - 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".public java.time.Instant getModificationTime()
public java.nio.file.Path getSourceFile()
getSourceFile().toAbsolutePath().toString() for the serialized form since the
serialization could change independently of the path representation.public AbsoluteUnixPath getExtractionPath()
public FilePermissions getPermissions()
public java.lang.String getOwnership()
public boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object