Skip to content

Commit

Permalink
Try to replace Files.createFile() to toFile().createNewFile() because…
Browse files Browse the repository at this point in the history
… windows...

#302
  • Loading branch information
Skidamek committed Nov 23, 2024
1 parent 0fb2827 commit 9c80a71
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ public static void copyFile(Path source, Path destination) throws IOException {
if (!Files.exists(destination.getParent())) {
Files.createDirectories(destination.getParent());
}
Files.createFile(destination);
// Windows? #302
// Files.createFile(destination);
destination.toFile().createNewFile();
}

try (RandomAccessFile sourceFile = new RandomAccessFile(source.toFile(), "r");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ private void downloadFile(String urlString, HashAndPath hashAndPath, QueuedDownl
}

if (!Files.exists(outFile)) {
Files.createFile(outFile);
// Windows? #302
outFile.toFile().createNewFile();
// Files.createFile(outFile);
}

URL url = new URL(urlString);
Expand Down

0 comments on commit 9c80a71

Please sign in to comment.