Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Handling empty directories #21

Closed
Tegomena opened this issue Nov 27, 2014 · 1 comment
Closed

Handling empty directories #21

Tegomena opened this issue Nov 27, 2014 · 1 comment

Comments

@Tegomena
Copy link

Dear all,

We found a problem when a payload contains an empty directory. The BagIt specification says something about handling empty directories (adding a ".keep" file), maybe the java lib should also act like this? The traceback we get:

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at
gov.loc.repository.bagit.writer.impl.FileSystemWriter.removeExtraFiles(FileSystemWriter.java:232)
at
gov.loc.repository.bagit.writer.impl.FileSystemWriter.write(FileSystemWriter.java:222)
at
de.mpg.rzg.tacoharvest.bagit.CreateBagitContainer.createBagIt(CreateBagitContainer.java:37)

Maybe a change in line 239 in gov.loc.repository.bagit.writer.impl.FileSystemWriter should be enough?:

if (recurse && file.listFiles().length > 0) {

johnscancella added a commit that referenced this issue Feb 1, 2016
@johnscancella
Copy link
Contributor

Should be fixed in version 4.11

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants