Class Bag
- java.lang.Object
- 
- uk.org.esciencelab.researchobjectservice.serialization.Bag
 
- 
 public class Bag extends java.lang.ObjectA class to construct BagIt bags.
- 
- 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddData(java.lang.String filename, byte[] bytes)Write bytes to a file to the bag.voidaddRemote(RemoteResource entry)Add a remote file to the bag.java.nio.file.PathgetDataFolder()java.util.Map<java.lang.String,java.util.Map<java.nio.file.Path,java.lang.String>>getEmptyChecksumMap()java.util.Map<java.lang.String,java.util.Map<java.nio.file.Path,java.lang.String>>getFileChecksums()java.util.List<java.io.File>getFiles()java.nio.file.PathgetLocation()java.lang.StringgetPayloadOxum()java.util.List<RemoteResource>getRemoteItems()java.lang.String[]getSupportedAlgorithms()
 
- 
- 
- 
Constructor Detail- 
Bagpublic Bag(java.nio.file.Path location) - Parameters:
- location- The location where to put the bag-in-progress (can be a temp directory!).
 
 - 
Bagpublic Bag(java.nio.file.Path location, java.lang.String[] checksumAlgorithms)- Parameters:
- location- The location where to put the bag-in-progress.
- checksumAlgorithms- An array of checksum algorithm names to use in the manifest and tagmanifest files.
 
 
- 
 - 
Method Detail- 
addDatapublic void addData(java.lang.String filename, byte[] bytes) throws java.security.NoSuchAlgorithmException, java.io.IOExceptionWrite bytes to a file to the bag.- Parameters:
- filename- The file name to write to, under data/.
- bytes- The bytes of the file to write.
- Throws:
- java.security.NoSuchAlgorithmException
- java.io.IOException
 
 - 
addRemotepublic void addRemote(RemoteResource entry) Add a remote file to the bag.- Parameters:
- entry- The remote file to add, as a RemoteResource object.
 
 - 
getLocationpublic java.nio.file.Path getLocation() 
 - 
getSupportedAlgorithmspublic java.lang.String[] getSupportedAlgorithms() 
 - 
getRemoteItemspublic java.util.List<RemoteResource> getRemoteItems() 
 - 
getFilespublic java.util.List<java.io.File> getFiles() 
 - 
getFileChecksumspublic java.util.Map<java.lang.String,java.util.Map<java.nio.file.Path,java.lang.String>> getFileChecksums() 
 - 
getPayloadOxumpublic java.lang.String getPayloadOxum() 
 - 
getDataFolderpublic java.nio.file.Path getDataFolder() throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
getEmptyChecksumMappublic java.util.Map<java.lang.String,java.util.Map<java.nio.file.Path,java.lang.String>> getEmptyChecksumMap() 
 
- 
 
-