1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.argeo.slc.core.deploy;
17
18 import java.io.File;
19 import java.util.Map;
20 import java.util.TreeMap;
21
22 import org.apache.commons.logging.Log;
23 import org.apache.commons.logging.LogFactory;
24 import org.argeo.slc.build.Distribution;
25 import org.argeo.slc.deploy.DeploymentData;
26 import org.argeo.slc.deploy.InstalledExecutables;
27 import org.argeo.slc.deploy.TargetData;
28
29 public class SimpleExecutables implements InstalledExecutables {
30 private final static Log log = LogFactory.getLog(SimpleExecutables.class);
31
32 private String baseDir;
33 private Map<String, String> paths = new TreeMap<String, String>();
34
35 private Distribution distribution;
36
37 public String getExecutablePath(String key) {
38 String path = paths.get(key);
39 if (path == null) {
40 if (log.isDebugEnabled())
41 log.debug("No executable path found for key " + key
42 + ", using the key as executable name.");
43 path = key;
44 }
45
46 if (baseDir != null)
47 path = baseDir + File.separator + path;
48 return path;
49 }
50
51 public String getDeployedSystemId() {
52
53 return null;
54 }
55
56 public DeploymentData getDeploymentData() {
57
58 return null;
59 }
60
61 public Distribution getDistribution() {
62 return distribution;
63 }
64
65 public TargetData getTargetData() {
66
67 return null;
68 }
69
70 public String getBaseDir() {
71 return baseDir;
72 }
73
74 public void setBaseDir(String baseDir) {
75 this.baseDir = baseDir;
76 }
77
78 public Map<String, String> getPaths() {
79 return paths;
80 }
81
82 public void setPaths(Map<String, String> paths) {
83 this.paths = paths;
84 }
85
86 public void setDistribution(Distribution distribution) {
87 this.distribution = distribution;
88 }
89
90 }