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 SummaryFields 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 SummaryAll 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- 
bagprotected Bag bag 
 - 
tagFileChecksumsprotected java.util.Map<java.lang.String,java.util.Map<java.nio.file.Path,java.lang.String>> tagFileChecksums 
 
- 
 - 
Constructor Detail- 
BagWriterpublic BagWriter(Bag bag) Create a new BagIt writer for the given bag.- Parameters:
- bag- The bag to write.
 
 
- 
 - 
Method Detail- 
writepublic void write() throws java.io.IOException, java.security.NoSuchAlgorithmExceptionWrite the bag!- Throws:
- java.io.IOException
- java.security.NoSuchAlgorithmException
 
 - 
writeTagFilesprotected void writeTagFiles() throws java.io.IOException, java.security.NoSuchAlgorithmException- Throws:
- java.io.IOException
- java.security.NoSuchAlgorithmException
 
 - 
writeFetchprotected void writeFetch() throws java.io.IOException, java.security.NoSuchAlgorithmException- Throws:
- java.io.IOException
- java.security.NoSuchAlgorithmException
 
 - 
writeBagItprotected void writeBagIt() throws java.io.IOException, java.security.NoSuchAlgorithmException- Throws:
- java.io.IOException
- java.security.NoSuchAlgorithmException
 
 - 
writeBagInfoprotected void writeBagInfo() throws java.io.IOException, java.security.NoSuchAlgorithmException- Throws:
- java.io.IOException
- java.security.NoSuchAlgorithmException
 
 - 
writeManifestprotected void writeManifest(java.lang.String algorithm) throws java.io.IOException, java.security.NoSuchAlgorithmException- Throws:
- java.io.IOException
- java.security.NoSuchAlgorithmException
 
 - 
writeTagManifestprotected void writeTagManifest(java.lang.String algorithm) throws java.io.IOException, java.security.NoSuchAlgorithmException- Throws:
- java.io.IOException
- java.security.NoSuchAlgorithmException
 
 - 
updateChecksumMapprotected 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)
 
- 
 
-