]> git.argeo.org Git - gpl/argeo-slc.git/blob - eclipse/plugins/org.argeo.slc.ui.launch/src/main/java/org/argeo/slc/ui/launch/DefaultSlcRuntime.java
Remove duplicated packages causing conflicts
[gpl/argeo-slc.git] / eclipse / plugins / org.argeo.slc.ui.launch / src / main / java / org / argeo / slc / ui / launch / DefaultSlcRuntime.java
1 package org.argeo.slc.ui.launch;
2
3 import java.io.File;
4 import java.io.IOException;
5 import java.util.List;
6 import java.util.Vector;
7
8 public class DefaultSlcRuntime implements SlcRuntime {
9 private File baseDir;
10 private String relLibDir = "lib";
11
12 public DefaultSlcRuntime(String baseDirPath) {
13 try {
14 this.baseDir = new File(baseDirPath).getCanonicalFile();
15 } catch (IOException e) {
16 throw new RuntimeException("Cannot get path for " + baseDirPath, e);
17 }
18 }
19
20 public String[] getClasspath() {
21 List<String> classpath = new Vector<String>();
22 File libDir = new File(baseDir.getPath() + File.separator + relLibDir);
23 File[] files = libDir.listFiles();
24 for (File file : files) {
25 try {
26 classpath.add(file.getCanonicalPath());
27 } catch (IOException e) {
28 throw new RuntimeException("Cannot get path for " + file, e);
29 }
30 }
31 return classpath.toArray(new String[classpath.size()]);
32 }
33
34 public String getAntHome() {
35 return baseDir.getPath();
36 }
37
38 public String getJavaLibraryPath() {
39 return baseDir.getPath() + File.separator + "bin";
40 }
41
42
43 }