-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed fetch issue #103
Closed
Closed
Fixed fetch issue #103
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
4d0834d
Fixed bagDataDir argument in PayloadWriterTest#testWritePayloadFilesM…
ThomasJejkal f4ec574
Removed DIFFERENT_NORMALIZATION from expected warnings again in order…
9695dad
Replaced Inserting with Upserting again in MessageBundle.properties
0761353
Fixed tab size for indention to 2
7b2ce33
Applied Eclipse formatting
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,38 +16,39 @@ | |
import gov.loc.repository.bagit.reader.MetadataReader; | ||
|
||
/** | ||
* Part of the BagIt conformance suite. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As far as I can tell, this file only contains formatting changes, is that correct? |
||
* This checker checks the bag metadata (bag-info.txt) for various problems. | ||
* Part of the BagIt conformance suite. This checker checks the bag metadata | ||
* (bag-info.txt) for various problems. | ||
*/ | ||
public final class MetadataChecker { | ||
private static final Logger logger = LoggerFactory.getLogger(MetadataChecker.class); | ||
private static final ResourceBundle messages = ResourceBundle.getBundle("MessageBundle"); | ||
private MetadataChecker(){ | ||
//intentionally left empty | ||
|
||
private MetadataChecker() { | ||
// intentionally left empty | ||
} | ||
public static void checkBagMetadata(final Path bagitDir, final Charset encoding, final Set<BagitWarning> warnings, | ||
final Collection<BagitWarning> warningsToIgnore) throws IOException, InvalidBagMetadataException{ | ||
|
||
public static void checkBagMetadata(final Path bagitDir, final Charset encoding, final Set<BagitWarning> warnings, | ||
final Collection<BagitWarning> warningsToIgnore) throws IOException, InvalidBagMetadataException { | ||
checkForPayloadOxumMetadata(bagitDir, encoding, warnings, warningsToIgnore); | ||
} | ||
|
||
/* | ||
* Check that the metadata contains the Payload-Oxum key-value pair | ||
*/ | ||
private static void checkForPayloadOxumMetadata(final Path bagitDir, final Charset encoding, final Set<BagitWarning> warnings, | ||
final Collection<BagitWarning> warningsToIgnore) throws IOException, InvalidBagMetadataException{ | ||
if(!warningsToIgnore.contains(BagitWarning.PAYLOAD_OXUM_MISSING)){ | ||
private static void checkForPayloadOxumMetadata(final Path bagitDir, final Charset encoding, | ||
final Set<BagitWarning> warnings, | ||
final Collection<BagitWarning> warningsToIgnore) throws IOException, InvalidBagMetadataException { | ||
if (!warningsToIgnore.contains(BagitWarning.PAYLOAD_OXUM_MISSING)) { | ||
final List<SimpleImmutableEntry<String, String>> metadata = MetadataReader.readBagMetadata(bagitDir, encoding); | ||
boolean containsPayloadOxum = false; | ||
for(final SimpleImmutableEntry<String, String> pair : metadata){ | ||
if("Payload-Oxum".equals(pair.getKey())){ | ||
|
||
for (final SimpleImmutableEntry<String, String> pair : metadata) { | ||
if ("Payload-Oxum".equals(pair.getKey())) { | ||
containsPayloadOxum = true; | ||
} | ||
} | ||
if(!containsPayloadOxum){ | ||
|
||
if (!containsPayloadOxum) { | ||
logger.warn(messages.getString("missing_payload_oxum_warning")); | ||
warnings.add(BagitWarning.PAYLOAD_OXUM_MISSING); | ||
} | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as far as I can tell, this file only contains formatting changes, is that correct?