Skip to content

Commit b0eea3b

Browse files
updated the readme with info on the bag linter
1 parent 67b36ea commit b0eea3b

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,21 @@ public class MyNewNameMapping implements BagitAlgorithmNameToSupportedAlgorithmM
104104
```
105105
and then add the implemented BagitAlgorithmNameToSupportedAlgorithmMapping class to your BagReader or bagVerifier object before using their methods
106106

107+
#### Check for potential problems
108+
The BagIt format is extremely flexible, and allows for many different implementations. While something may technically be correct there are known issues that can be avoided. That is why we created a Bag Linter, which checks for very well known issues that can occur. Here is an example where we check for all known issues:
109+
```java
110+
Path rootDir = Paths.get("RootDirectoryOfExistingBag");
111+
BagLinter linter = new BagLinter();
112+
List<BagitWarning> warnings = linter.lintBag(rootDir, Collections.emptyList());
113+
```
114+
115+
You can also ignore any of the warnings by passing them into the list like so:
116+
```java
117+
dependencycheckth rootDir = Paths.get("RootDirectoryOfExistingBag");
118+
BagLinter linter = new BagLinter();
119+
List<BagitWarning> warnings = linter.lintBag(rootDir, Arrays.asList(BagitWarning.OLD_BAGIT_VERSION);
120+
```
121+
107122
## Developing Bagit-Java
108123
Bagit-Java uses [Gradle](https://gradle.org/) for its build system. Check out the great [documentation](https://docs.gradle.org/current/userguide/userguide_single.html) to learn more.
109124
##### Running tests and code quality checks

0 commit comments

Comments
 (0)