do nothing if current and original path is exactly the same

This commit is contained in:
Reinhard Pointner 2016-05-16 01:49:54 +08:00
parent d277315f39
commit d886f6569f
1 changed files with 5 additions and 0 deletions

View File

@ -134,6 +134,11 @@ public enum StandardRenameAction implements RenameAction {
}
public static File revert(File current, File original) throws IOException {
// do nothing if current and original path is exactly the same
if (current.equals(original)) {
return original;
}
// reverse move
if (current.exists() && !original.exists()) {
return FileUtilities.moveRename(current, original);