1
2
3
4
5
6
7
8
9
10
11 package org.astrogrid.jes.component.production;
12
13 import org.astrogrid.component.descriptor.SimpleComponentDescriptor;
14 import org.astrogrid.config.Config;
15 import org.astrogrid.jes.impl.workflow.FileJobFactoryImpl.BaseDirectory;
16
17 import java.io.File;
18
19 /*** Configuration object for {@link org.astrogrid.jes.impl.workflow.FileJobFactoryImpl}
20 * <p>
21 *
22 * @author Noel Winstanley nw@jb.man.ac.uk 07-Mar-2004
23 */
24 public class BaseDirectoryFromConfig extends SimpleComponentDescriptor implements BaseDirectory {
25 /*** key to look in config for base directory */
26 public static final String BASE_DIR_KEY = "jes.jobfactory.file.basedir";
27 public BaseDirectoryFromConfig(Config conf) {
28 String fileLoc = conf.getString(BASE_DIR_KEY,System.getProperty("java.io.tmpdir"));
29 baseDir = new File(fileLoc);
30 name = "FileJobFactory - Base Directory configuration";
31 description = "Loads base-directory configuration parameter for FileJobFactory from Config\n" +
32 "key :" + BASE_DIR_KEY
33 + "\n current value:" + baseDir.getAbsolutePath();
34 }
35 private final File baseDir;
36 /***
37 * @see org.astrogrid.jes.impl.workflow.FileJobFactoryImpl.BaseDirectory#getDir()
38 */
39 public File getDir() {
40 return baseDir;
41 }
42
43 }
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63