]>
git.argeo.org Git - gpl/argeo-slc.git/blob - eclipse/plugins/org.argeo.slc.ui.launch/src/main/java/org/argeo/slc/ui/launch/DeployedSlcSystem.java
1 package org
.argeo
.slc
.ui
.launch
;
4 import java
.io
.IOException
;
6 import java
.util
.Vector
;
8 import org
.eclipse
.core
.runtime
.CoreException
;
9 import org
.eclipse
.jdt
.launching
.IVMInstall
;
10 import org
.eclipse
.jdt
.launching
.JavaRuntime
;
12 public class DeployedSlcSystem
implements SlcSystem
{
14 private String relLibDir
= "lib";
16 public DeployedSlcSystem(String baseDirPath
) {
18 this.baseDir
= new File(baseDirPath
).getCanonicalFile();
19 } catch (IOException e
) {
20 throw new RuntimeException("Cannot get path for " + baseDirPath
, e
);
24 public String
[] getClasspath() throws CoreException
{
25 List
<String
> classpath
= new Vector
<String
>();
26 File libDir
= new File(baseDir
.getPath() + File
.separator
+ relLibDir
);
27 File
[] files
= libDir
.listFiles();
28 for (File file
: files
) {
30 classpath
.add(file
.getCanonicalPath());
31 } catch (IOException e
) {
32 throw new RuntimeException("Cannot get path for " + file
, e
);
35 return classpath
.toArray(new String
[classpath
.size()]);
38 public IVMInstall
getVmInstall() throws CoreException
{
39 return JavaRuntime
.getDefaultVMInstall();
42 public String
getAntHome() {
43 return baseDir
.getPath();
46 public String
getJavaLibraryPath() {
47 return baseDir
.getPath() + File
.separator
+ "bin";