1
0
Fork 0

destination was file, not folder

This commit is contained in:
Xavier Fontanet 2024-05-25 13:02:43 +02:00
parent f0223ed727
commit 7241986b99
1 changed files with 5 additions and 4 deletions

View File

@ -23,11 +23,12 @@ class FileCopier {
}
}
private void createDestinationFolderIfApply(Path destination) throws IOException {
if (isTemporaryDestination(destination) && !Files.exists(destination)) {
System.out.printf("destination folder %s will be created", destination);
private void createDestinationFolderIfApply(Path destinationFile) throws IOException {
var destinationFolder = destinationFile.getParent();
if (isTemporaryDestination(destinationFolder) && !Files.exists(destinationFolder)) {
System.out.printf("destination folder %s will be created", destinationFolder);
if (ConfigLoader.isDisabled(TEST_MODE))
Files.createDirectory(destination);
Files.createDirectories(destinationFile);
}
}