diff --git a/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/commands/ManageSPIMBenchmark.java b/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/commands/ManageSPIMBenchmark.java index aaee9aaba7db792fe47c1bb91240321e5ad74402..f6e05832b6690660acc1cd696a463de5cb4f9883 100644 --- a/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/commands/ManageSPIMBenchmark.java +++ b/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/commands/ManageSPIMBenchmark.java @@ -4,6 +4,7 @@ import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.io.File; import java.io.IOException; +import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; @@ -61,7 +62,9 @@ public class ManageSPIMBenchmark implements Command { public void run() { try { Path workingDirPath = Paths.get(workingDirectory.getPath()); - + if (!Files.isDirectory(workingDirPath)) { + Files.createDirectories(workingDirPath); + } FileLock fl = new FileLock(workingDirPath.resolve(LOCK_FILE_NAME)); if(!fl.tryLock()) { uiService.showDialog("Working directory is already used by someone else", MessageType.ERROR_MESSAGE); diff --git a/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/ui/BenchmarkSPIMControl.java b/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/ui/BenchmarkSPIMControl.java index bc58039c73e125e91dbb60e437db539b6b267280..4678ed7518f86e7ae81d5ed7c2d35786d6cb67e8 100644 --- a/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/ui/BenchmarkSPIMControl.java +++ b/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/ui/BenchmarkSPIMControl.java @@ -143,7 +143,7 @@ public class BenchmarkSPIMControl extends BorderPane implements CloseableControl job -> JavaFXRoutines.notNullValue(job, j -> !j.isUseDemoData() && !EnumSet.of(JobState.Running, JobState.Disposed).contains(j.getState())), - job -> job.getUploadProgress().isWorking()); + job -> job != null && job.getUploadProgress().isWorking()); menu.addItem("Download result", job -> executeWSCallAsync("Downloading data", p -> job.getValue().startDownload()), job -> executeWSCallAsync("Stop downloading data", p -> job.getValue().stopDownload()), @@ -151,7 +151,7 @@ public class BenchmarkSPIMControl extends BorderPane implements CloseableControl .notNullValue(job, j -> EnumSet.of(JobState.Failed, JobState.Finished, JobState.Canceled) .contains(j.getState()) && j.canBeDownloaded()), - job -> job.getDownloadProgress().isWorking()); + job -> job != null && job.getDownloadProgress().isWorking()); menu.addItem("Download statistics", job -> executeWSCallAsync("Downloading data", p -> job.getValue().downloadStatistics(p)),