Fix the problem with the disappearing link to the job archive file
[proteocache.git] / engine / compbio / engine / archive / ArchivedJob.java
index 2c2c2ab..08ec64b 100644 (file)
@@ -39,6 +39,9 @@ public class ArchivedJob {
                String resultpath = ph.getProperty("archive.web.dir");
                String thefile = ph.getProperty("archive.path") + '/' + jobfilename;
                String finalpath = ProteoCachePropertyHelperManager.getLocalPath() + resultpath + '/' + jobfilename;
+               if (Files.isReadable(Paths.get(finalpath))) {
+                       Files.delete(Paths.get(finalpath));
+               }
                if (Files.isReadable(Paths.get(thefile))) {
                        Files.copy(Paths.get(thefile), Paths.get(finalpath));
                        return  resultpath + '/' + jobfilename;