Skip to content
Snippets Groups Projects
Commit 208d279d authored by Petr Bainar's avatar Petr Bainar
Browse files

iss1011: implementing fileExists method

parent 45bd29ae
No related branches found
No related tags found
1 merge request!5Iss1011
package cz.it4i.fiji.haas_spim_benchmark.core; package cz.it4i.fiji.haas_spim_benchmark.core;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.FileWriter; import java.io.FileWriter;
import java.io.IOException; import java.io.IOException;
...@@ -67,9 +68,9 @@ public class BenchmarkJobManager { ...@@ -67,9 +68,9 @@ public class BenchmarkJobManager {
} }
@Override @Override
public boolean fileExists(String fileName) { public boolean fileExists(Path filePath) {
// TASK 1011 modify interface of job for checking of file existence File f = new File(filePath.toString());
return false; return f.exists() && !f.isDirectory();
} }
}; };
...@@ -147,8 +148,7 @@ public class BenchmarkJobManager { ...@@ -147,8 +148,7 @@ public class BenchmarkJobManager {
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
if (obj instanceof BenchmarkJob) { if (obj instanceof BenchmarkJob) {
BenchmarkJob job = (BenchmarkJob) obj; return ((BenchmarkJob) obj).getId() == getId();
return job.getId() == getId();
} }
return false; return false;
} }
......
package cz.it4i.fiji.haas_spim_benchmark.core; package cz.it4i.fiji.haas_spim_benchmark.core;
import java.nio.file.Path;
import cz.it4i.fiji.haas.HaaSOutputHolder; import cz.it4i.fiji.haas.HaaSOutputHolder;
public interface SPIMComputationAccessor extends HaaSOutputHolder { public interface SPIMComputationAccessor extends HaaSOutputHolder {
boolean fileExists(String fileName); boolean fileExists(Path fileName);
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment