Skip to content

Commit f4d04dc

Browse files
committed
updated examples with Java.nio.Paths
1 parent 83bc4c7 commit f4d04dc

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,20 @@ The "new" bagit interface is very intuitive, but here are some easy to follow ex
2929

3030
##### Create a bag from a folder using version 0.97
3131
```java
32-
File folder = new File("FolderYouWantToBag");
32+
Path folder = Paths.get("FolderYouWantToBag");
3333
StandardSupportedAlgorithms algorithm = StandardSupportedAlgorithms.MD5;
3434
boolean includeHiddenFiles = false;
3535
Bag bag = BagCreator.bagInPlace(folder, algorithm, includeHiddenFiles);
3636
```
3737
##### Read an existing bag (version 0.93 and higher)
3838
```java
39-
File rootDir = new File("RootDirectoryOfExistingBag");
39+
Path rootDir = Paths.get("RootDirectoryOfExistingBag");
4040
BagReader reader = new BagReader();
4141
Bag bag = reader.read(rootDir);
4242
```
4343
##### Write a Bag object to disk
4444
```java
45-
File outputDir = new File("WhereYouWantToWriteTheBagTo");
45+
Path outputDir = Paths.get("WhereYouWantToWriteTheBagTo");
4646
BagWriter.write(bag, outputDir); //where bag is a Bag object
4747
```
4848
##### Verify Complete

0 commit comments

Comments
 (0)