Class DirectoryManifest

java.lang.Object
com.netflix.genie.common.internal.dtos.DirectoryManifest

public class DirectoryManifest extends Object
A manifest of all the files and subdirectories in a directory.
Since:
4.0.0
  • Constructor Details

    • DirectoryManifest

      public DirectoryManifest(Set<DirectoryManifest.ManifestEntry> entries)
      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

      public boolean hasEntry(String path)
      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 or Optional.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

      public Set<DirectoryManifest.ManifestEntry> 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