Skip to content

Commit 485579a

Browse files
committed
delete the file first and then the directory
1 parent 6a1293e commit 485579a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/lowtuna/jsonblob/core/BlobCleanupProducer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ protected boolean handleDirectory(File directory, int depth, Collection<Void> re
6565
} else if (fileCount.get() == 1) {
6666
File[] files = directory.listFiles();
6767
if (files != null && files[0].getName().startsWith(FileSystemJsonBlobManager.BLOB_METADATA_FILE_NAME)) {
68-
if (directory.delete()) {
68+
if (files[0].delete() && directory.delete()) {
6969
log.info("{} has only a metadata file, so it's being deleted", directory.getAbsolutePath());
7070
}
7171
}

0 commit comments

Comments
 (0)