Class BagWriter
- java.lang.Object
-
- uk.org.esciencelab.researchobjectservice.serialization.BagWriter
-
- Direct Known Subclasses:
BagItROCrateWriter,BagItROWriter
public class BagWriter extends java.lang.ObjectA class for writing all necessary tag files etc. for a given Bag as a plain BagIt bag.
-
-
Field Summary
Fields Modifier and Type Field Description protected Bagbagprotected java.util.Map<java.lang.String,java.util.Map<java.nio.file.Path,java.lang.String>>tagFileChecksums
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidupdateChecksumMap(java.util.Map<java.lang.String,java.util.Map<java.nio.file.Path,java.lang.String>> checksumMap, StreamWithDigests stream, java.nio.file.Path path)voidwrite()Write the bag!protected voidwriteBagInfo()protected voidwriteBagIt()protected voidwriteFetch()protected voidwriteManifest(java.lang.String algorithm)protected voidwriteTagFiles()protected voidwriteTagManifest(java.lang.String algorithm)
-
-
-
Field Detail
-
bag
protected Bag bag
-
tagFileChecksums
protected java.util.Map<java.lang.String,java.util.Map<java.nio.file.Path,java.lang.String>> tagFileChecksums
-
-
Constructor Detail
-
BagWriter
public BagWriter(Bag bag)
Create a new BagIt writer for the given bag.- Parameters:
bag- The bag to write.
-
-
Method Detail
-
write
public void write() throws java.io.IOException, java.security.NoSuchAlgorithmExceptionWrite the bag!- Throws:
java.io.IOExceptionjava.security.NoSuchAlgorithmException
-
writeTagFiles
protected void writeTagFiles() throws java.io.IOException, java.security.NoSuchAlgorithmException- Throws:
java.io.IOExceptionjava.security.NoSuchAlgorithmException
-
writeFetch
protected void writeFetch() throws java.io.IOException, java.security.NoSuchAlgorithmException- Throws:
java.io.IOExceptionjava.security.NoSuchAlgorithmException
-
writeBagIt
protected void writeBagIt() throws java.io.IOException, java.security.NoSuchAlgorithmException- Throws:
java.io.IOExceptionjava.security.NoSuchAlgorithmException
-
writeBagInfo
protected void writeBagInfo() throws java.io.IOException, java.security.NoSuchAlgorithmException- Throws:
java.io.IOExceptionjava.security.NoSuchAlgorithmException
-
writeManifest
protected void writeManifest(java.lang.String algorithm) throws java.io.IOException, java.security.NoSuchAlgorithmException- Throws:
java.io.IOExceptionjava.security.NoSuchAlgorithmException
-
writeTagManifest
protected void writeTagManifest(java.lang.String algorithm) throws java.io.IOException, java.security.NoSuchAlgorithmException- Throws:
java.io.IOExceptionjava.security.NoSuchAlgorithmException
-
updateChecksumMap
protected void updateChecksumMap(java.util.Map<java.lang.String,java.util.Map<java.nio.file.Path,java.lang.String>> checksumMap, StreamWithDigests stream, java.nio.file.Path path)
-
-