Fix the problem with the disappearing link to the job archive file
authorSasha Sherstnev <a.sherstnev@dundee.ac.uk>
Fri, 20 Dec 2013 11:36:48 +0000 (11:36 +0000)
committerSasha Sherstnev <a.sherstnev@dundee.ac.uk>
Fri, 20 Dec 2013 11:36:48 +0000 (11:36 +0000)
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;