diff --git a/source/net/filebot/Settings.properties b/source/net/filebot/Settings.properties index 8aea3c609..e2c30df31 100644 --- a/source/net/filebot/Settings.properties +++ b/source/net/filebot/Settings.properties @@ -1,6 +1,6 @@ # application settings application.name: FileBot -application.version: 4.7.19.2 +application.version: 4.7.19.3 application.revision: @{revision} # application updates diff --git a/source/net/filebot/util/FileUtilities.java b/source/net/filebot/util/FileUtilities.java index cbaec6d96..bff1333db 100644 --- a/source/net/filebot/util/FileUtilities.java +++ b/source/net/filebot/util/FileUtilities.java @@ -26,6 +26,7 @@ import java.nio.file.FileVisitResult; import java.nio.file.Files; import java.nio.file.LinkOption; +import java.nio.file.NoSuchFileException; import java.nio.file.Path; import java.nio.file.SimpleFileVisitor; import java.nio.file.StandardCopyOption; @@ -76,14 +77,20 @@ public static File moveRename(File source, File destination) throws IOException // but ATOMIC_MOVE can only work for files on the same drive, if that is not the case there is no point trying move with ATOMIC_MOVE if (source.equals(destination)) { try { - return Files.move(source.toPath(), destination.toPath(), StandardCopyOption.ATOMIC_MOVE).toFile(); + Files.move(source.toPath(), destination.toPath(), StandardCopyOption.ATOMIC_MOVE).toFile(); } catch (AtomicMoveNotSupportedException e) { debug.warning(e::toString); } + return destination; } // Linux and Mac OS X - return Files.move(source.toPath(), destination.toPath(), StandardCopyOption.REPLACE_EXISTING).toFile(); + try { + Files.move(source.toPath(), destination.toPath(), StandardCopyOption.REPLACE_EXISTING).toFile(); + } catch (NoSuchFileException e) { + debug.warning(e::toString); + } + return destination; } public static File copyAs(File source, File destination) throws IOException { @@ -97,7 +104,12 @@ public static File copyAs(File source, File destination) throws IOException { } // copy file - return Files.copy(source.toPath(), destination.toPath(), StandardCopyOption.REPLACE_EXISTING).toFile(); + try { + Files.copy(source.toPath(), destination.toPath(), StandardCopyOption.REPLACE_EXISTING).toFile(); + } catch (NoSuchFileException e) { + debug.warning(e::toString); + } + return destination; } public static File resolve(File source, File destination) {