Package org.cdlib.mrt.s3.tools
Class BuildObjectManifest
java.lang.Object
org.cdlib.mrt.s3.tools.BuildObjectManifest
this routine is used to build a manifest.xml file from content saved in cloud.
Note that the constructed manifest.xml will only contain additions and content replacement.
If any component was deleted in later versions it cannot be identified by this routine.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
BuildObjectManifest
(CloudStoreInf cloud, String container, File directory, org.cdlib.mrt.utility.LoggerInf logger) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoid
addManifest
(String objectIDS, File manifestFile, boolean addIt, boolean replaceIt) void
Replace manifest.xml back into cloud for this objectBuild manifest.xmlprotected org.cdlib.mrt.core.FileComponent
buildComponent
(String objectIDS, org.cdlib.mrt.cloud.CloudList.CloudEntry entry) protected ArrayList<org.cdlib.mrt.core.FileComponent>
buildVersion
(org.cdlib.mrt.cloud.VersionMap map, String objectIDS, int version) protected void
closeStream
(InputStream inStream) static BuildObjectManifest
getBuildObjectManifest
(CloudStoreInf cloud, String container, File directory, org.cdlib.mrt.utility.LoggerInf logger) Get object for constructing manifestprotected org.cdlib.mrt.cloud.CloudList
getObjectList
(String prefix) protected List<org.cdlib.mrt.core.FileComponent>
mergeComponents
(HashMap<String, org.cdlib.mrt.core.FileComponent> hashComponents, List<org.cdlib.mrt.core.FileComponent> components) protected void
setDigest
(org.cdlib.mrt.core.FileComponent component) protected void
setFile
(String key, CloudUtil.KeyElements keyEle, org.cdlib.mrt.core.FileComponent component) protected File
setManifest
(String objectIDS, org.cdlib.mrt.cloud.VersionMap map)
-
Field Details
-
NAME
- See Also:
-
MESSAGE
- See Also:
-
DEBUG
protected static final boolean DEBUG- See Also:
-
NL
-
logger
protected org.cdlib.mrt.utility.LoggerInf logger -
directory
-
cloud
-
container
-
tika
protected org.cdlib.mrt.core.Tika tika
-
-
Constructor Details
-
BuildObjectManifest
protected BuildObjectManifest(CloudStoreInf cloud, String container, File directory, org.cdlib.mrt.utility.LoggerInf logger) throws org.cdlib.mrt.utility.TException Constructor- Parameters:
cloud
- Cloud access object interfacecontainer
- container/bucket of cloud storage containing objectdirectory
- local directory file to contain extracted content from cloudlogger
- Merritt logger- Throws:
org.cdlib.mrt.utility.TException
-
-
Method Details
-
getBuildObjectManifest
public static BuildObjectManifest getBuildObjectManifest(CloudStoreInf cloud, String container, File directory, org.cdlib.mrt.utility.LoggerInf logger) throws org.cdlib.mrt.utility.TException Get object for constructing manifest- Parameters:
cloud
- Cloud access object interfacecontainer
- container/bucket of cloud storage containing objectdirectory
- local directory file to contain extracted content from cloudlogger
- Merritt logger- Throws:
org.cdlib.mrt.utility.TException
-
build
public File build(String objectIDS, boolean addIt, boolean replaceIt) throws org.cdlib.mrt.utility.TException Build manifest.xml- Parameters:
objectIDS
-- Returns:
- File containing manifest.xml
- Throws:
org.cdlib.mrt.utility.TException
-
mergeComponents
protected List<org.cdlib.mrt.core.FileComponent> mergeComponents(HashMap<String, org.cdlib.mrt.core.FileComponent> hashComponents, List<org.cdlib.mrt.core.FileComponent> components) throws org.cdlib.mrt.utility.TException- Throws:
org.cdlib.mrt.utility.TException
-
buildVersion
protected ArrayList<org.cdlib.mrt.core.FileComponent> buildVersion(org.cdlib.mrt.cloud.VersionMap map, String objectIDS, int version) throws org.cdlib.mrt.utility.TException - Throws:
org.cdlib.mrt.utility.TException
-
getObjectList
protected org.cdlib.mrt.cloud.CloudList getObjectList(String prefix) throws org.cdlib.mrt.utility.TException - Throws:
org.cdlib.mrt.utility.TException
-
buildComponent
protected org.cdlib.mrt.core.FileComponent buildComponent(String objectIDS, org.cdlib.mrt.cloud.CloudList.CloudEntry entry) throws org.cdlib.mrt.utility.TException - Throws:
org.cdlib.mrt.utility.TException
-
setFile
protected void setFile(String key, CloudUtil.KeyElements keyEle, org.cdlib.mrt.core.FileComponent component) throws org.cdlib.mrt.utility.TException - Throws:
org.cdlib.mrt.utility.TException
-
setDigest
protected void setDigest(org.cdlib.mrt.core.FileComponent component) throws org.cdlib.mrt.utility.TException - Throws:
org.cdlib.mrt.utility.TException
-
setManifest
protected File setManifest(String objectIDS, org.cdlib.mrt.cloud.VersionMap map) throws org.cdlib.mrt.utility.TException - Throws:
org.cdlib.mrt.utility.TException
-
addOld
public void addOld(String objectIDS, File manifestFile, boolean addIt) throws org.cdlib.mrt.utility.TException Replace manifest.xml back into cloud for this object- Parameters:
objectIDS
- String objectID for contentmanifestFile
- Manifest file to be added- Throws:
org.cdlib.mrt.utility.TException
-
addManifest
public void addManifest(String objectIDS, File manifestFile, boolean addIt, boolean replaceIt) throws org.cdlib.mrt.utility.TException - Throws:
org.cdlib.mrt.utility.TException
-
closeStream
- Throws:
org.cdlib.mrt.utility.TException
-