Updated classpath loader in response to new directory structure in the Cordformation.

This commit is contained in:
Clinton Alexander 2016-10-06 16:04:38 +01:00
parent 959dbfeacb
commit f56fea551d

View File

@ -25,15 +25,15 @@ public class CordaCaplet extends Capsule {
// defined as public static final fields on the Capsule class, therefore referential equality is safe.
if(ATTR_APP_CLASS_PATH == attr) {
T cp = super.attribute(attr);
List<Path> classpath = (List<Path>) cp;
return (T) augmentClasspath(classpath);
List<Path> classpath = augmentClasspath((List<Path>) cp, "plugins");
return (T) augmentClasspath(classpath, "dependencies");
}
return super.attribute(attr);
}
// TODO: Make directory configurable via the capsule manifest.
// TODO: Add working directory variable to capsules string replacement variables.
private List<Path> augmentClasspath(List<Path> classpath) {
private List<Path> augmentClasspath(List<Path> classpath, String dirName) {
File dir = new File("plugins");
if(!dir.exists()) {
dir.mkdir();