Skip to content
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

Complete and validate #13

Merged
merged 14 commits into from
Aug 7, 2018
Merged

Complete and validate #13

merged 14 commits into from
Aug 7, 2018

Conversation

rvanheest
Copy link
Contributor

@rvanheest rvanheest commented Jul 12, 2018

Fixes #1

Implements

  • isComplete
  • isValid

...according to the BagIt specs. Both methods return Either[String, Unit], meaning that if the bag is complete/valid, it returns Right[Unit] and if the bag is not complete/valid, it returns Left[String], with the String containing the message why the bag is not complete/valid.

@janvanmansum @lindareijnhoudt @jo-pol for review

@rvanheest rvanheest added this to the Dans-Bag milestone Jul 12, 2018

/**
* Verifies if a bag is complete.
* According to the BagIt v16 specs, a bag is complete when:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use spelled out "version 16" for the release "versions" and "V1.0", "V0.97" for main versions.

/**
* Verifies if a bag is complete.
* According to the BagIt v16 specs, a bag is complete when:
* <ul>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use Scaladoc "markdown" (?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't find it. you got a reference?

(bag / "bagit.txt").toJava should exist
bag.data.toJava should exist
bag.glob("manifest-*.txt").toList should not be empty
bag.fetchFiles shouldBe empty
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need to check first if your test data is correct?

@rvanheest rvanheest requested a review from jo-pol August 7, 2018 07:50
@rvanheest rvanheest merged commit 31c63a9 into master Aug 7, 2018
@rvanheest rvanheest deleted the complete-and-validate branch August 7, 2018 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants