Fix Bug in NativeUtils
authorMaximilian Quellmalz <maximilian.quellmalz@mailbox.tu-dresden.de>
Fri, 12 Dec 2014 11:27:03 +0000 (12:27 +0100)
committerMaximilian Quellmalz <maximilian.quellmalz@mailbox.tu-dresden.de>
Fri, 12 Dec 2014 11:27:03 +0000 (12:27 +0100)
Splitter-ng-plugin-bitsplitter/src/cz/adamh/utils/NativeUtils.java
Splitter-ng-plugin-jerasure/src/cz/adamh/utils/NativeUtils.java

index 0f80bb6..3eb4536 100644 (file)
@@ -65,6 +65,9 @@ public class NativeUtils {
                // Prepare temporary file
                String tempDir = System.getProperty("java.io.tmpdir");
                File temp = new File(tempDir+"/"+prefix+suffix);
+               if (temp.exists()){
+                       temp.delete();
+               }
                Files.createFile(temp.toPath());
                temp.deleteOnExit();
                
index 3924240..1a14848 100644 (file)
@@ -61,6 +61,9 @@ public class NativeUtils {
                // Prepare temporary file
                String tempDir = System.getProperty("java.io.tmpdir");
                File temp = new File(tempDir+"/"+prefix+suffix);
+               if (temp.exists()){
+                       temp.delete();
+               }
                Files.createFile(temp.toPath());
                temp.deleteOnExit();