1 package compbio.engine.archive;
4 import java.io.IOException;
6 import org.apache.log4j.Logger;
8 import compbio.engine.ProteoCachePropertyHelperManager;
9 import compbio.util.PropertyHelper;
11 public class Archive {
12 private static final PropertyHelper ph = ProteoCachePropertyHelperManager.getPropertyHelper();
13 private static Logger log = Logger.getLogger(Archive.class);
15 private String archivepath;
17 private boolean archiveexist;
19 public Archive() throws IOException {
20 String path = ph.getProperty("archive.path");
21 assert (null != path);
23 if (isAbsolutePath (path)) {
26 String abspath = ProteoCachePropertyHelperManager.getLocalPath();
27 archivepath = abspath + "/" + path;
29 if (!isDirExists(archivepath)) {
30 archiveexist = (new File(archivepath).mkdirs());
34 private boolean isAbsolutePath (String path) {
35 return (new File(path).isAbsolute());
38 private boolean isDirExists (String path) throws IOException {
39 archive = new File(path);
40 return archive.getCanonicalFile().isDirectory();
44 public boolean addArchivedJob (ArchivedJob job) {
48 public String createJob(String jobid) {
49 return archivepath + "/" + jobid + ".tar.gz";