Skip to content

Commit

Permalink
Revert "fix: skip files if cleaned to empty filename (#3166)"
Browse files Browse the repository at this point in the history
This reverts commit 3fdc06a.
  • Loading branch information
iBotPeaches committed Jul 19, 2023
1 parent 3fdc06a commit 70ae213
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions brut.j.dir/src/main/java/brut/directory/DirUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,10 @@ public static void copyToDir(Directory in, File out, String fileName)
// Skip copies of directories/files not found.
} else {
String cleanedFilename = BrutIO.sanitizeUnknownFile(out, fileName);
if (! cleanedFilename.isEmpty()) {
File outFile = new File(out, cleanedFilename);
//noinspection ResultOfMethodCallIgnored
outFile.getParentFile().mkdirs();
BrutIO.copyAndClose(in.getFileInput(fileName), Files.newOutputStream(outFile.toPath()));
}
File outFile = new File(out, cleanedFilename);
//noinspection ResultOfMethodCallIgnored
outFile.getParentFile().mkdirs();
BrutIO.copyAndClose(in.getFileInput(fileName), Files.newOutputStream(outFile.toPath()));
}
} catch (RootUnknownFileException | InvalidUnknownFileException | TraversalUnknownFileException exception) {
LOGGER.warning(String.format("Skipping file %s (%s)", fileName, exception.getMessage()));
Expand Down

0 comments on commit 70ae213

Please sign in to comment.