Class FetchItem

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

public final class FetchItem extends Object
An individual item to fetch as specified by https://tools.ietf.org/html/draft-kunze-bagit-13#section-2.2.3
  • Field Details

    • url

      public final URL url
      The url from which the item can be downloaded
    • length

      public final Long length
      The length of the file in octets
    • path

      public final Path path
      The path where the fetched item should be put
    • cachedString

      private transient String cachedString
  • Constructor Details

    • FetchItem

      public FetchItem(URL url, Long length, Path path)
      Parameters:
      url - the URL of the file
      length - the file length in bytes, -1 or null to not specify the length
      path - the path in the bag where the file belongs
  • Method Details

    • internalToString

      private String internalToString()
    • toString

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

      public URL getUrl()
    • getLength

      public Long getLength()
    • getPath

      public Path getPath()
    • hashCode

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

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