diff --git a/source/net/filebot/util/FileUtilities.java b/source/net/filebot/util/FileUtilities.java index ece2f97a..1b621993 100644 --- a/source/net/filebot/util/FileUtilities.java +++ b/source/net/filebot/util/FileUtilities.java @@ -102,12 +102,10 @@ public final class FileUtilities { destination = new File(source.getParentFile(), destination.getPath()); } - // make sure we that we can create the destination folder structure - File destinationFolder = destination.getParentFile(); - // create parent folder if necessary - if (mkdirs && !destinationFolder.isDirectory() && !destinationFolder.mkdirs()) { - throw new IOException("Failed to create folder: " + destinationFolder); + if (mkdirs) { + // make sure that the folder structure is created, and throw exception if the folder structure can't be created + Files.createDirectories(destination.getParentFile().toPath()); } return destination;