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;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
......@@ -67,9 +68,9 @@ public class BenchmarkJobManager {
}
@Override
public boolean fileExists(String fileName) {
// TASK 1011 modify interface of job for checking of file existence
return false;
public boolean fileExists(Path filePath) {
File f = new File(filePath.toString());
return f.exists() && !f.isDirectory();
}
};
......@@ -147,8 +148,7 @@ public class BenchmarkJobManager {
@Override
public boolean equals(Object obj) {
if (obj instanceof BenchmarkJob) {
BenchmarkJob job = (BenchmarkJob) obj;
return job.getId() == getId();
return ((BenchmarkJob) obj).getId() == getId();
}
return false;
}
......
package cz.it4i.fiji.haas_spim_benchmark.core;
import java.nio.file.Path;
import cz.it4i.fiji.haas.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