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

BUG: tmp file creation

parent b0388279
No related branches found
No related tags found
No related merge requests found
...@@ -40,7 +40,6 @@ import java.io.IOException; ...@@ -40,7 +40,6 @@ 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.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;
...@@ -306,9 +305,8 @@ public class FileUtils { ...@@ -306,9 +305,8 @@ public class FileUtils {
if (target.exists()) { if (target.exists()) {
// in case this is a update transaction, the old version of the file // in case this is a update transaction, the old version of the file
// must be stored somewhere until the transaction is done. // must be stored somewhere until the transaction is done.
final File tmp = final File tmp = new File(new File(FileSystem.getTmp()), target.getName() + Utils.getUID());
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