Skip to content
Snippets Groups Projects
Unverified Commit cd428240 authored by Timm Fitschen's avatar Timm Fitschen
Browse files

BUG: and again the file renaming

parent 5f8e2f28
No related branches found
No related tags found
No related merge requests found
...@@ -40,6 +40,8 @@ import java.io.IOException; ...@@ -40,6 +40,8 @@ import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.io.Reader; import java.io.Reader;
import java.nio.file.CopyOption;
import java.nio.file.StandardCopyOption;
import java.security.MessageDigest; import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException; import java.security.NoSuchAlgorithmException;
import java.util.Arrays; import java.util.Arrays;
...@@ -307,7 +309,7 @@ public class FileUtils { ...@@ -307,7 +309,7 @@ public class FileUtils {
// must be stored somewhere until the transaction is done. // must be stored somewhere until the transaction is done.
final File tmp = final File tmp =
File.createTempFile(target.getName(), Utils.getUID(), new File(FileSystem.getTmp())); File.createTempFile(target.getName(), Utils.getUID(), new File(FileSystem.getTmp()));
java.nio.file.Files.move(target.toPath(), tmp.toPath()); java.nio.file.Files.move(target.toPath(), tmp.toPath(), StandardCopyOption.REPLACE_EXISTING);
backup = tmp; backup = tmp;
} else { } else {
backup = null; backup = null;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment