Files.createDirectories
may throw java.nio.file.FileAlreadyExistsException
in certain cases (conflict with docs)
@see https://github.com/filebot/filebot/issues/40#issuecomment-338475728
This commit is contained in:
parent
3a3ccba37e
commit
a3085de6fc
@ -114,7 +114,10 @@ public final class FileUtilities {
|
||||
destination = resolve(source, destination);
|
||||
|
||||
// create parent folder if necessary and make sure that the folder structure is created, and throw exception if the folder structure can't be created
|
||||
Files.createDirectories(destination.getParentFile().toPath());
|
||||
Path parentFolder = destination.toPath().getParent();
|
||||
if (Files.notExists(parentFolder)) {
|
||||
Files.createDirectories(parentFolder);
|
||||
}
|
||||
|
||||
return destination;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user