Packages

class DansV0Bag extends DansBag

Linear Supertypes
DansBag, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. DansV0Bag
  2. DansBag
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def addBagInfo(key: String, value: String): DansV0Bag

    Add an entry to the bagInfo.

    Add an entry to the bagInfo. Please note that this will only be synced with bag-info.txt once DansBag#save is called.

    key

    the key of the new entry

    value

    the value of the new entry

    returns

    this bag, with the new entry added

    Definition Classes
    DansV0BagDansBag
  5. def addFetchItem(url: URL, pathInData: Path): Try[DansV0Bag]

    Adds the triple (url, length, path) to the fetch.txt.

    Adds the triple (url, length, path) to the fetch.txt. If the path already exists in the fetch, or in the payload, an Exception will occur. The PayloadManifests are updated with the checksum of the downloaded file. The length will be calculated as well.

    Due to calculating the checksums for all files, as well as downloading all fetch files, this method may take some time to complete and return. It is therefore strongly advised to wrap a call to this method in a Promise/Future, Observable or any other desired data structure that deals with latency in a proper way.

    Please note that this will only be synced with fetch.txt and manifest-<alg>.txt once DansBag#save is called.

    url

    the url where the file is to be retrieved from

    pathInData

    the path relative to the bag/data directory where the new file is virtually being placed

    returns

    this bag, with the new FetchItem

    Definition Classes
    DansV0BagDansBag
  6. def addPayloadFile(src: File, pathInData: Path)(implicit importOption: ImportOption): Try[DansV0Bag]

    Add a payload file to the bag at the position indicated by the path relative to the bag/data directory.

    Add a payload file to the bag at the position indicated by the path relative to the bag/data directory. If the resolved destination of this new file already exists within the bag, or if the resolved destination is outside of the bag/data directory, this method will return a scala.util.Failure. This method also adds the checksum of the new file to all payload manifests.

    The way of adding the payload file is determined by the implicit parameter importOption. By default this is set to COPY. If set to MOVE, it will move the file if both source and destination are on the same mount, but will copy/delete otherwise. If set to ATOMIC_MOVE, it will move the file if both source and destination are on the same mount, but fail otherwise.

    When src is a directory, each file in that directory will be copied into the payload directory. If MOVE is selected for importOption, importing a directory structure is not allowed.

    Please note that fetch files are also considered part of the payload files. Therefore it is not allowed to add a payload file using this method that is already declared in fetch.txt.

    Please note that, while the new file is added to the bag immediately, the changes to the payload manifests will only be applied to the bag on the file system once DansBag#save is called.

    src

    the source of the new file to be added to the bag

    pathInData

    the path relative to the bag/data directory where the new file is being placed

    importOption

    the method of adding the payload file, either COPY, MOVE or ATOMIC_MOVE

    returns

    this bag, with the added checksums of the new payload file

    Definition Classes
    DansV0BagDansBag
  7. def addPayloadFile(inputStream: InputStream, pathInData: Path): Try[DansV0Bag]

    Add a payload file from an java.io.InputStream to the bag at the position indicated by the path relative to the bag/data directory.

    Add a payload file from an java.io.InputStream to the bag at the position indicated by the path relative to the bag/data directory. If the resolved destination of this new file already exists within the bag, or if the resolved destination is outside of the bag/data directory, this method will return a scala.util.Failure. This method also adds the checksum of the new file to all payload manifests.

    Please note that fetch files are also considered part of the payload files. Therefore it is not allowed to add a payload file using this method that is already declared in fetch.txt.

    Please note that, while the new file is added to the bag immediately, the changes to the payload manifests will only be applied to the bag on the file system once DansBag#save is called.

    inputStream

    the source of the new file to be added to the bag

    pathInData

    the path relative to the bag/data directory where the new file is being placed

    returns

    this bag, with the added checksums of the new payload file

    Definition Classes
    DansV0BagDansBag
  8. def addPayloadManifestAlgorithm(checksumAlgorithm: ChecksumAlgorithm, updateManifest: Boolean = false): Try[DansV0Bag]

    Add an algorithm to the bag that will be used for calculating the checksums of the payload files.

    Add an algorithm to the bag that will be used for calculating the checksums of the payload files. This method can also be used to update the checksums of payload files in case some files were mutated by other means than the use of this library. Supply updateManifest = true (default false) for this behaviour. In both use cases of this method, the payload manifest will be added to all tag manifests with a temporary value, indicating that the real checksum for the payload manifest will only be recalculated on calling DansBag#save. Since fetch files are also listed in all payload manifests, this method will upon encountering fetch files, download them using the specified URL and calculate their checksums according to the new/updated algorithm. Afterwards the downloaded files are deleted.

    Due to calculating the checksums for all files, as well as downloading all fetch files, this method may take some time to complete and return. It is therefore strongly advised to wrap a call to this method in a Promise/Future, Observable or any other desired data structure that deals with latency in a proper way.

    Please note that this new/updated algorithm will only be added to the bag on the file system once DansBag#save is called.

    checksumAlgorithm

    the algorithm for which the payload checksums will be added or updated

    updateManifest

    indicates whether it should update (true) or add (false) the algorithm

    returns

    this bag, with the new algorithm added

    Definition Classes
    DansV0BagDansBag
  9. def addTagFile(src: File, pathInBag: Path): Try[DansV0Bag]

    Add a tag file to the bag at the position indicated by the path relative to the bag's base directory.

    Add a tag file to the bag at the position indicated by the path relative to the bag's base directory. If the resolved destination of this new file already exists within the bag, or if the resolved destination is outside of the base directory, inside the bag/data directory or if it is equal to one of the reserved files (bagit.txt, bag-info.txt, fetch.txt, manifest-*.txt or tagmanifest-*.txt) this method will return a scala.util.Failure. This method also adds the checksum of the new file to all tag manifests.

    When src is a directory, each file will in that directory will be copied into the payload directory.

    Please note that, while the new file is added to the bag immediately, the changes to the tag manifests will only be applied to the bag on the file system once DansBag#save is called.

    src

    the source of the new file to be added to the bag

    pathInBag

    the path relative to the bag's base directory where the new file is being placed

    returns

    this bag, with the added checksums of the new tag file

    Definition Classes
    DansV0BagDansBag
  10. def addTagFile(inputStream: InputStream, pathInBag: Path): Try[DansV0Bag]

    Add a tag file from an java.io.InputStream to the bag at the position indicated by the path relative to the bag's base directory.

    Add a tag file from an java.io.InputStream to the bag at the position indicated by the path relative to the bag's base directory. If the resolved destination of this new file already exists within the bag, or if the resolved destination is outside of the base directory, inside the bag/data directory or if it is equal to one of the reserved files (bagit.txt, bag-info.txt, fetch.txt, manifest-*.txt or tagmanifest-*.txt) this method will return a scala.util.Failure. This method also adds the checksum of the new file to all tag manifests.

    Please note that, while the new file is added to the bag immediately, the changes to the tag manifests will only be applied to the bag on the file system once DansBag#save is called.

    inputStream

    the source of the new file to be added to the bag

    pathInBag

    the path relative to the bag's base directory where the new file is being placed

    returns

    this bag, with the added checksums of the new tag file

    Definition Classes
    DansV0BagDansBag
  11. def addTagManifestAlgorithm(checksumAlgorithm: ChecksumAlgorithm, updateManifest: Boolean = false): Try[DansV0Bag]

    Add an algorithm to the bag that will be used for calculating the checksums of the tag files.

    Add an algorithm to the bag that will be used for calculating the checksums of the tag files. This method can also be used to update the checksums of tag files in case some files were mutated by other means than the use of this library. Supply updateManifest = true (default false) for this behaviour.

    Please note that this new/updated algorithm will only be added to the bag on the file system once DansBag#save is called.

    checksumAlgorithm

    the algorithm for which the tagfiles' checksums will be added or updated

    updateManifest

    indicates whether it should update (true) or add (false) the algorithm

    returns

    this bag, with the new algorithm added

    Definition Classes
    DansV0BagDansBag
  12. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  13. def bagInfo: Map[String, Seq[String]]

    List all entries of bag/bag-info.txt.

    List all entries of bag/bag-info.txt. Key-value pairs will be grouped on key, such that if any key is listed multiple times, their values will end up together in a Seq[String].

    returns

    a Map containing all entries of bag/bag-info.txt

    Definition Classes
    DansV0BagDansBag
  14. def bagitVersion: Version

    returns

    the bag's gov.loc.repository.bagit.domain.Version, which is stored in bagit.txt

    Definition Classes
    DansV0BagDansBag
  15. val baseDir: File

    The base directory of the bag this object represents

    The base directory of the bag this object represents

    Definition Classes
    DansV0BagDansBag
  16. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  17. def created: Try[Option[DateTime]]

    Retrieves the value for key 'Created' from bag-info.txt as a parsed org.joda.time.DateTime object.

    Retrieves the value for key 'Created' from bag-info.txt as a parsed org.joda.time.DateTime object. If this key has an invalid value, a Failure is returned instead. If the key is not present, a Success(None) is returned instead.

    returns

    the DateTime object found in the 'Created' key in bag-info.txt

    Definition Classes
    DansV0BagDansBag
  18. val data: File

    The data directory of the bag this object represents

    The data directory of the bag this object represents

    Definition Classes
    DansV0BagDansBag
  19. implicit def disposeURLConnection: Disposable[URLConnection]
    Attributes
    protected
  20. def easyUserAccount: Try[Option[String]]

    Retrieves the value for the 'EASY-User-Account' key.

    Retrieves the value for the 'EASY-User-Account' key.

    returns

    the EASY user account value

    Definition Classes
    DansV0BagDansBag
  21. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  22. def equals(obj: Any): Boolean
    Definition Classes
    DansV0Bag → AnyRef → Any
  23. def fetchFiles: Seq[FetchItem]

    Lists all files that are stated in fetch.txt.

    Lists all files that are stated in fetch.txt.

    returns

    all entries listed in fetch.txt

    Definition Classes
    DansV0BagDansBag
  24. def fileEncoding: Charset

    returns

    the bag's java.nio.charset.Charset, which is stored in bagit.txt

    Definition Classes
    DansV0BagDansBag
  25. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  26. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  27. def hashCode(): Int
    Definition Classes
    DansV0Bag → AnyRef → Any
  28. def isComplete(executor: ExecutorService): Either[String, Unit]
    Definition Classes
    DansV0BagDansBag
  29. def isComplete: Either[String, Unit]

    Verifies if a bag is complete.

    Verifies if a bag is complete. According to the BagIt version 16 specs, a bag is complete when:

    • bagit.txt is present
    • data/ directory is present
    • at least one payload manifest exists
    • all fetch items are present in the bag
    • all files in every payload manifest must be present
    • all files in every tag manifest must be present
    • (>= V1.0 bag) all files in the payload directory are listed in all payload manifests
    • (< V1.0 bag) all files in the payload directory are listed in at least one payload manifest
    returns

    either Unit (if the bag is complete) or String (containing the error message if the bag is not complete)

    Definition Classes
    DansV0BagDansBag
  30. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  31. def isValid(executor: ExecutorService): Either[String, Unit]
    Definition Classes
    DansV0BagDansBag
  32. def isValid: Either[String, Unit]

    Verifies if a bag is valid.

    Verifies if a bag is valid. According to the BagIt v16 specs, a bag is valid when:

    • the bag is complete
    • every checksum in every payload manifest has been successfully verified against the contents of the corresponding file
    • every checksum in every tag manifest has been successfully verified against the contents of the corresponding file

    Due to calculating the checksums for all files, this method may take some time to complete and return. It is therefore strongly advised to wrap a call to this method in a Promise/Future, Observable or any other desired data structure that deals with latency in a proper way.

    returns

    either Unit (if the bag is valid) or String (containing the error message if the bag is not valid)

    Definition Classes
    DansV0BagDansBag
  33. def isVersionOf: Try[Option[URI]]

    Retrieves the value for key 'Is-Version-Of' from bag-info.txt as a java.net.URI object.

    Retrieves the value for key 'Is-Version-Of' from bag-info.txt as a java.net.URI object. If this key has an invalid value (if it does not match the pattern urn:uuid:[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}), a Failure is returned instead. If the key is not present, a Success(None) is returned instead.

    returns

    the URI object found in the 'Is-Version-Of' key in bag-info.txt

    Definition Classes
    DansV0BagDansBag
  34. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  35. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  36. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  37. def openConnection(url: URL): Dispose[URLConnection]
    Attributes
    protected
  38. def payloadManifestAlgorithms: Set[ChecksumAlgorithm]

    List all algorithms that are being used in this bag to calculate the checksums of the payload files.

    List all algorithms that are being used in this bag to calculate the checksums of the payload files.

    returns

    the set of algorithms used for calculating the payload's checksums

    Definition Classes
    DansV0BagDansBag
  39. def payloadManifests: Map[ChecksumAlgorithm, Map[File, String]]

    For each algorithm, list the mappings of payload file to its checksum.

    For each algorithm, list the mappings of payload file to its checksum.

    returns

    the mapping of payload file to its checksum, for each algorithm

    Definition Classes
    DansV0BagDansBag
  40. def removeBagInfo(key: String): DansV0Bag

    Remove all entries with the given key.

    Remove all entries with the given key. Please note that this will only be synced with bag-info.txt once DansBag#save is called.

    key

    the key to be removed

    returns

    this bag, without the removed entries

    Definition Classes
    DansV0BagDansBag
  41. def removeFetchItem(item: FetchItem): DansV0Bag

    Removes the fetchitem with this pathInData from the fetch.txt and the PayloadManifests.

    Removes the fetchitem with this pathInData from the fetch.txt and the PayloadManifests.

    Please note that this will only be synced with fetch.txt and manifest-<alg>.txt once DansBag#save is called.

    item

    the FetchItem to be removed

    returns

    this bag, without the FetchItem

    Definition Classes
    DansV0BagDansBag
  42. def removeFetchItem(url: URL): Try[DansV0Bag]

    Removes the fetchitem with this pathInData from the fetch.txt and the PayloadManifests.

    Removes the fetchitem with this pathInData from the fetch.txt and the PayloadManifests.

    Please note that this will only be synced with fetch.txt and manifest-<alg>.txt once DansBag#save is called.

    url

    the url of the fetchitem to be removed

    returns

    this bag, without the fetchitem

    Definition Classes
    DansV0BagDansBag
  43. def removeFetchItem(pathInData: Path): Try[DansV0Bag]

    Removes the fetchitem with this pathInData from the fetch.txt and the PayloadManifests.

    Removes the fetchitem with this pathInData from the fetch.txt and the PayloadManifests.

    Please note that this will only be synced with fetch.txt and manifest-<alg>.txt once DansBag#save is called.

    pathInData

    the path relative to the bag/data directory of the fetchitem to be removed

    returns

    this bag, without the fetchitem

    Definition Classes
    DansV0BagDansBag
  44. def removePayloadFile(pathInData: Path): Try[DansV0Bag]

    Remove the payload file (relative to the bag/data directory) from the bag.

    Remove the payload file (relative to the bag/data directory) from the bag. This also removes the related entries from all payload manifests. If the removal of this file causes a directory to be empty, it is removed from the bag as well. However, an empty bag/data directory is preserved. If the given file does not exist or is not inside the bag/data directory or it is a directory, a scala.util.Failure is returned.

    Please note that, while the file is removed from the bag immediately, the changes to the payload manifests will only be applied to the bag on the file system once DansBag#save is called.

    pathInData

    the path to the file within bag/data that is being removed

    returns

    this bag, without the payload manifest entries for the removed file

    Definition Classes
    DansV0BagDansBag
  45. def removePayloadManifestAlgorithm(checksumAlgorithm: ChecksumAlgorithm): Try[DansV0Bag]

    Remove an algorithm from the bag, which was used for calculating the checksums of the payload files.

    Remove an algorithm from the bag, which was used for calculating the checksums of the payload files. It also removes the payload manifest from all tagmanifests as well.

    Please note that this change will only be applied to the bag on the file system once DansBag#save is called.

    checksumAlgorithm

    the algorithm to be removed from the bag with respect to the payload files

    returns

    this bag, without the removed algorithm

    Definition Classes
    DansV0BagDansBag
  46. def removeTagFile(pathInBag: Path): Try[DansV0Bag]

    Remove the tag file (relative to the bag's base directory) from the bag.

    Remove the tag file (relative to the bag's base directory) from the bag. This also removes the related entries from all tag manifests. If the removal of this file causes a directory to be empty, it is removed from the bag as well. If the given file does not exist, or is inside the bag/data directory, outside/equal to the base directory, or is a directory, or is one of the reserved files (bagit.txt, bag-info.txt, fetch.txt, manifest-*.txt or tagmanifest-*.txt) a scala.util.Failure is returned.

    Please note that, while the file is removed from the bag immediately, the changes to the tag manifests will only be applied to the bag on the file system once DansBag#save is called.

    pathInBag

    the path to the file within the bag's base directory that is being removed

    returns

    this bag, without the tag manifest entries for the removed file

    Definition Classes
    DansV0BagDansBag
  47. def removeTagManifestAlgorithm(checksumAlgorithm: ChecksumAlgorithm): Try[DansV0Bag]

    Remove an algorithm from the bag, which was used for calculating the checksums of the tag files.

    Remove an algorithm from the bag, which was used for calculating the checksums of the tag files.

    Please note that this change will only be applied to the bag on the file system once DansBag#save is called.

    checksumAlgorithm

    the algorithm to be removed from the bag with respect to the tag files

    returns

    this bag, without the removed algorithm

    Definition Classes
    DansV0BagDansBag
  48. def replaceFetchItemWithFile(item: FetchItem): Try[DansV0Bag]

    Downloads a file from the list of fetch files (indicated by the FetchItem) through the corresponding URL and stores it at its original place.

    Downloads a file from the list of fetch files (indicated by the FetchItem) through the corresponding URL and stores it at its original place. The original reference in fetch.txt is removed.

    If the checksum(s) of the downloaded file do(es) not match the checksum(s) listed in the payload manifest(s), a Failure will be returned.

    Due to downloading the file, this method may take some time to complete and return. It is therefore strongly advised to wrap a call to this method in a Promise/Future, Observable or any other desired data structure that deals with latency in a proper way.

    Please note that this change is applied immediately and, since no changes are made to the rest of the bag, there is no need to call DansBag#save for this to have full effect.

    item

    the FetchItem containing the URL and path to the file in the bag/data directory

    returns

    this bag, after having downloaded the file

    Definition Classes
    DansV0BagDansBag
  49. def replaceFetchItemWithFile(url: URL): Try[DansV0Bag]

    Downloads a file from the list of fetch files (indicated by the URL) and stores it at its original place, as indicated by the fetch.txt file.

    Downloads a file from the list of fetch files (indicated by the URL) and stores it at its original place, as indicated by the fetch.txt file. The original reference in fetch.txt is removed.

    If the checksum(s) of the downloaded file do(es) not match the checksum(s) listed in the payload manifest(s), a Failure will be returned.

    Due to downloading the file, this method may take some time to complete and return. It is therefore strongly advised to wrap a call to this method in a Promise/Future, Observable or any other desired data structure that deals with latency in a proper way.

    Please note that this change is applied immediately and, since no changes are made to the rest of the bag, there is no need to call DansBag#save for this to have full effect.

    url

    a URL that is listed in the fetch file and through which the file can be downloaded

    returns

    this bag, after having downloaded the file

    Definition Classes
    DansV0BagDansBag
  50. def replaceFetchItemWithFile(pathInData: Path): Try[DansV0Bag]

    Downloads a file from the list of fetch files (indicated by the relative path to bag/data) through the corresponding URL and stores it at its original place.

    Downloads a file from the list of fetch files (indicated by the relative path to bag/data) through the corresponding URL and stores it at its original place. The original reference in fetch.txt is removed.

    If the checksum(s) of the downloaded file do(es) not match the checksum(s) listed in the payload manifest(s), a Failure will be returned. In this case, the file is not added to the payload directory.

    Due to downloading the file, this method may take some time to complete and return. It is therefore strongly advised to wrap a call to this method in a Promise/Future, Observable or any other desired data structure that deals with latency in a proper way.

    Please note that this change is applied immediately and, since no changes are made to the rest of the bag, there is no need to call DansBag#save for this to have full effect.

    pathInData

    a relative path in bag/data that is listed in the fetch file and where the file is stored on file system after being downloaded

    returns

    this bag, after having downloaded the file

    Definition Classes
    DansV0BagDansBag
  51. def replaceFileWithFetchItem(pathInData: Path, url: URL): Try[DansV0Bag]

    Migrates a file from the payload directory to the fetch file, where it is referenced by the given URL.

    Migrates a file from the payload directory to the fetch file, where it is referenced by the given URL. If the resolved path of the original file does not exist in the bag, or if the resolved path is outside of the bag/data directory, a Failure is returned. The URL is not checked for its resolvability, nor is this method responsible for uploading the referenced file to the specific URL.

    Please note that, while the file is removed from the bag immediately, the changes to the fetch file will only be applied to the bag on the file system once DansBag#save is called.

    pathInData

    the path in bag/data to the file that is included in the fetch file

    url

    the URL through which the file will be resolved in the future

    returns

    this bag, with the added reference in the fetch file

    Definition Classes
    DansV0BagDansBag
  52. def save(): Try[Unit]

    Save all changes made to this bag (using the above methods) to the file system.

    Save all changes made to this bag (using the above methods) to the file system.

    If there are no payload algorithms left (due to excessive calls to DansBag#removePayloadManifestAlgorithm), this method will fail before any writing to the file system is performed. It will also fail if the bag is not writeable.

    First the bagit.txt file is saved, containing the bag's version and the tag file encoding. Next, all payload manifests are removed and new files are created for the registered payload algorithms. Then, bag-info.txt is regenerated, including a refreshed 'Payload-Oxum', 'Bagging-Date' and 'Bag-Size'. Next, if there are any fetch files added to the bag, the fetch.txt file is created. If instead the fetch files were being removed from the bag, fetch.txt is deleted. Finally, all tag manifests are recalculated and saved in both this bag and on the file system.

    returns

    scala.util.Success if the save was performed successfully, scala.util.Failure otherwise

    Definition Classes
    DansV0BagDansBag
  53. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  54. def tagManifestAlgorithms: Set[ChecksumAlgorithm]

    List all algorithms that are being used in this bag to calculate the checksums of the tag files.

    List all algorithms that are being used in this bag to calculate the checksums of the tag files.

    returns

    the set of algorithms used for calculating the tagfiles' checksums

    Definition Classes
    DansV0BagDansBag
  55. def tagManifests: Map[ChecksumAlgorithm, Map[File, String]]

    For each algorithm, list the mappings of tag file to its checksum.

    For each algorithm, list the mappings of tag file to its checksum.

    returns

    the mapping of tag file to its checksum, for each algorithm

    Definition Classes
    DansV0BagDansBag
  56. def toString(): String
    Definition Classes
    DansV0Bag → AnyRef → Any
  57. def validateURL(url: URL): Unit
    Attributes
    protected
  58. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  59. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  60. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  61. def withBagitVersion(major: Int, minor: Int): DansV0Bag

    Change the bag's gov.loc.repository.bagit.domain.Version to a new Version.

    Change the bag's gov.loc.repository.bagit.domain.Version to a new Version. Please note that this will only be synced with bagit.txt once DansBag#save is called.

    major

    major part of the version number

    minor

    minor part of the version number

    returns

    this bag, with a new Version comprised of the major and minor inputs

    Definition Classes
    DansV0BagDansBag
  62. def withBagitVersion(version: Version): DansV0Bag

    Change the bag's gov.loc.repository.bagit.domain.Version to a new Version.

    Change the bag's gov.loc.repository.bagit.domain.Version to a new Version. Please note that this will only be synced with bagit.txt once DansBag#save is called.

    version

    the new Version of the bag

    returns

    this bag, with the new Version

    Definition Classes
    DansV0BagDansBag
  63. def withCreated(created: DateTime = DateTime.now()): DansV0Bag

    Adds the key 'Created' from bag-info.txt.

    Adds the key 'Created' from bag-info.txt. If the key is already present, it is replaced with the new value. When no argument is supplied, a default value DateTime.now() is used instead. Please note that this will only be synced with bag-info.txt once DansBag#save is called.

    created

    the DateTime object on which the bag's content was created

    returns

    this bag, with the new value for 'Created' in bag-info.txt

    Definition Classes
    DansV0BagDansBag
  64. def withEasyUserAccount(userId: String): DansV0Bag

    Adds userId under the key 'EASY-User-Account' to bag-info.txt.

    Adds userId under the key 'EASY-User-Account' to bag-info.txt. If the key is already present the value is overwritten.

    Please, note that this will not be persisted to disk until DansBag#save is used.

    returns

    the modified DansBag

    Definition Classes
    DansV0BagDansBag
  65. def withFileEncoding(charset: Charset): DansV0Bag

    Change the bag's java.nio.charset.Charset to a new Charset.

    Change the bag's java.nio.charset.Charset to a new Charset. Please note that this will only be synced with bagit.txt once DansBag#save is called.

    charset

    the new Charset of the bag

    returns

    this bag, with the new Charset

    Definition Classes
    DansV0BagDansBag
  66. def withIsVersionOf(uuid: UUID): DansV0Bag

    Adds the key 'Is-Version-Of' from bag-info.txt.

    Adds the key 'Is-Version-Of' from bag-info.txt. If the key is already present, it is replaced with the new value. The given java.util.UUID is used to construct a java.net.URI of the form urn:uuid:[uuid]. Please note that this will only be synced with bag-info.txt once DansBag#save is called.

    uuid

    the UUID of the previous revision of this bag

    returns

    this bag, with the new value for 'Is-Version-Of' in bag-info.txt

    Definition Classes
    DansV0BagDansBag
  67. def withoutCreated(): DansV0Bag

    Remove the entry with key 'Created' from bag-info.txt.

    Remove the entry with key 'Created' from bag-info.txt. Please note that this will only be synced with bag-info.txt once DansBag#save is called.

    returns

    this bag, without the removed entry

    Definition Classes
    DansV0BagDansBag
  68. def withoutEasyUserAccount(): DansV0Bag

    Removes the entry with key 'EASY-User-Account' from bag-info.txt.

    Removes the entry with key 'EASY-User-Account' from bag-info.txt.

    Please, note that this will not be persisted to disk until DansBag#save is used.

    returns

    the modified DansBag

    Definition Classes
    DansV0BagDansBag
  69. def withoutIsVersionOf(): DansV0Bag

    Remove the entry with key 'Is-Version-Of' from bag-info.txt.

    Remove the entry with key 'Is-Version-Of' from bag-info.txt. Please note that this will only be synced with bag-info.txt once DansBag#save is called.

    returns

    this bag, without the removed entry

    Definition Classes
    DansV0BagDansBag

Inherited from DansBag

Inherited from AnyRef

Inherited from Any

Ungrouped