Class Bag

java.lang.Object
nl.knaw.dans.bagit.domain.Bag

public final class Bag extends Object
The main representation of the bagit spec.
  • Field Details

    • version

      private Version version
    • fileEncoding

      private Charset fileEncoding
    • payLoadManifests

      private Set<Manifest> payLoadManifests
    • tagManifests

      private Set<Manifest> tagManifests
    • itemsToFetch

      private List<FetchItem> itemsToFetch
    • metadata

      private Metadata metadata
    • rootDir

      private Path rootDir
  • Constructor Details

    • Bag

      public Bag()
      empty bag with an invalid version
    • Bag

      public Bag(Version version)
      empty bag with the specified bag version
      Parameters:
      version - the version of the bag
    • Bag

      public Bag(Bag bag)
      Create a new bag with the same values as the supplied bag
      Parameters:
      bag - the bag to clone
  • Method Details

    • getVersion

      public Version getVersion()
    • getPayLoadManifests

      public Set<Manifest> getPayLoadManifests()
    • setPayLoadManifests

      public void setPayLoadManifests(Set<Manifest> payLoadManifests)
    • getTagManifests

      public Set<Manifest> getTagManifests()
    • setTagManifests

      public void setTagManifests(Set<Manifest> tagManifests)
    • getItemsToFetch

      public List<FetchItem> getItemsToFetch()
    • setItemsToFetch

      public void setItemsToFetch(List<FetchItem> itemsToFetch)
    • getMetadata

      public Metadata getMetadata()
    • setMetadata

      public void setMetadata(Metadata metadata)
    • getFileEncoding

      public Charset getFileEncoding()
    • setFileEncoding

      public void setFileEncoding(Charset fileEncoding)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • getRootDir

      public Path getRootDir()
    • setRootDir

      public void setRootDir(Path rootDir)
    • setVersion

      public void setVersion(Version version)