Class DirectoryManifest
java.lang.Object
com.netflix.genie.common.internal.dtos.DirectoryManifest
A manifest of all the files and subdirectories in a directory.
- Since:
- 4.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Factory that encapsulates directory manifest creation.static interface
This interface defines a filter function used during creation of the manifest.static class
Representation of the metadata for a job file on a given underlying storage system. -
Constructor Summary
ConstructorsConstructorDescriptionCreate a manifest from an existing set of entries. -
Method Summary
Modifier and TypeMethodDescriptionGet all the entries that are directories for this manifest.Get the entry, if one exists, for the given path.getFiles()
Get all the entries that are files for this manifest.int
Get the total number of directories in this manifest.int
Get the total number of files in this manifest.long
Get the total size of the files contained in this manifest.boolean
Check whether an entry exists for the given path.
-
Constructor Details
-
DirectoryManifest
Create a manifest from an existing set of entries. Generally this should be used to regenerate an in memory manifest instance from JSON.- Parameters:
entries
- The entries in this manifest
-
-
Method Details
-
hasEntry
Check whether an entry exists for the given path.- Parameters:
path
- The path to check. Relative to the root of the original job directory.- Returns:
true
if an entry exists for this path
-
getEntry
Get the entry, if one exists, for the given path.- Parameters:
path
- The path to get an entry for. Relative to the root of the original job directory.- Returns:
- The entry wrapped in an
Optional
orOptional.empty()
if no entry exists
-
getFiles
Get all the entries that are files for this manifest.- Returns:
- All the file
DirectoryManifest.ManifestEntry
's as an immutable set.
-
getDirectories
Get all the entries that are directories for this manifest.- Returns:
- All the directory
DirectoryManifest.ManifestEntry
's as an immutable set.
-
getNumFiles
public int getNumFiles()Get the total number of files in this manifest.- Returns:
- The total number of files that are in this job directory
-
getNumDirectories
public int getNumDirectories()Get the total number of directories in this manifest.- Returns:
- The total number of sub directories that are in this job directory
-
getTotalSizeOfFiles
public long getTotalSizeOfFiles()Get the total size of the files contained in this manifest.- Returns:
- The total size (in bytes) of all the files in this job directory
-