Skip to content

Commit a7506f6

Browse files
author
Justin Littman
committed
refs #4. Adds payload and tag manifest algorithm options to update command.
1 parent 4f80aa6 commit a7506f6

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/main/java/gov/loc/repository/bagit/driver/CommandLineBagDriver.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ public CommandLineBagDriver() throws Exception {
267267

268268
this.addOperation(OPERATION_UPDATE,
269269
"Updates the manifests and (if it exists) the bag-info.txt for a bag.",
270-
new Parameter[] {sourceParam, optionalDestParam, writerParam, moveParam, compressionParam, manifestSeparatorParam},
270+
new Parameter[] {sourceParam, optionalDestParam, writerParam, moveParam, compressionParam, manifestSeparatorParam, tagManifestAlgorithmParam, payloadManifestAlgorithmParam},
271271
new String[] {MessageFormat.format("bag {0} {1} ", OPERATION_UPDATE, this.getBag("mybag"))});
272272

273273
this.addOperation(OPERATION_UPDATE_TAGMANIFESTS,
@@ -790,6 +790,8 @@ else if (fetchRetryString.equalsIgnoreCase("retry"))
790790
Bag bag = this.getBag(sourceFile, version, LoadOption.BY_FILES);
791791
try {
792792
UpdateCompleter updateCompleter = new UpdateCompleter(bagFactory);
793+
updateCompleter.setTagManifestAlgorithm(Algorithm.valueOfBagItAlgorithm(config.getString(PARAM_TAG_MANIFEST_ALGORITHM, Algorithm.MD5.bagItAlgorithm)));
794+
updateCompleter.setPayloadManifestAlgorithm(Algorithm.valueOfBagItAlgorithm(config.getString(PARAM_PAYLOAD_MANIFEST_ALGORITHM, Algorithm.MD5.bagItAlgorithm)));
793795
completer.setNonDefaultManifestSeparator(manifestSeparator);
794796
completer.addProgressListener(listener);
795797
Bag newBag = updateCompleter.complete(bag);

0 commit comments

Comments
 (0)