Loading plugins/org.etsi.mts.tdl.constraints/src/org/etsi/mts/tdl/constraints/evl/Validator.java +18 −13 Original line number Diff line number Diff line Loading @@ -111,19 +111,7 @@ public class Validator { for (String part : constraints) { String source = "epsilon/constraints/"+part; URI uri = new File(source).toURI(); //FIXED: also for TO? -> should work with all now if (Platform.isRunning()) { //System.out.println("Running as plugin..."); Bundle bundle = Platform.getBundle("org.etsi.mts.tdl.constraints"); URL url = bundle.getEntry(source); uri = url.toURI(); } else { //WS String binPath=this.getClass().getProtectionDomain().getCodeSource().getLocation().getPath(); String projectPath = new File(binPath).getParent(); uri = new File(projectPath+"/"+source).toURI(); } URI uri = getSourceUri(source); EvlModule module = new EvlModule(); module.parse(uri); Loading Loading @@ -188,6 +176,23 @@ public class Validator { return violations; } private URI getSourceUri(String source) throws URISyntaxException { URI uri = new File(source).toURI(); //FIXED: also for TO? -> should work with all now if (Platform.isRunning()) { //System.out.println("Running as plugin..."); Bundle bundle = Platform.getBundle("org.etsi.mts.tdl.constraints"); URL url = bundle.getEntry(source); uri = url.toURI(); } else { //WS String binPath=this.getClass().getProtectionDomain().getCodeSource().getLocation().getPath(); String projectPath = new File(binPath).getParent(); uri = new File(projectPath+"/"+source).toURI(); } return uri; } public void dumpViolations(List<UnsatisfiedConstraint> violations, boolean includeLocation) { for (UnsatisfiedConstraint constraint : violations) { System.out.println(" Validator: " + constraint.getMessage()); Loading Loading
plugins/org.etsi.mts.tdl.constraints/src/org/etsi/mts/tdl/constraints/evl/Validator.java +18 −13 Original line number Diff line number Diff line Loading @@ -111,19 +111,7 @@ public class Validator { for (String part : constraints) { String source = "epsilon/constraints/"+part; URI uri = new File(source).toURI(); //FIXED: also for TO? -> should work with all now if (Platform.isRunning()) { //System.out.println("Running as plugin..."); Bundle bundle = Platform.getBundle("org.etsi.mts.tdl.constraints"); URL url = bundle.getEntry(source); uri = url.toURI(); } else { //WS String binPath=this.getClass().getProtectionDomain().getCodeSource().getLocation().getPath(); String projectPath = new File(binPath).getParent(); uri = new File(projectPath+"/"+source).toURI(); } URI uri = getSourceUri(source); EvlModule module = new EvlModule(); module.parse(uri); Loading Loading @@ -188,6 +176,23 @@ public class Validator { return violations; } private URI getSourceUri(String source) throws URISyntaxException { URI uri = new File(source).toURI(); //FIXED: also for TO? -> should work with all now if (Platform.isRunning()) { //System.out.println("Running as plugin..."); Bundle bundle = Platform.getBundle("org.etsi.mts.tdl.constraints"); URL url = bundle.getEntry(source); uri = url.toURI(); } else { //WS String binPath=this.getClass().getProtectionDomain().getCodeSource().getLocation().getPath(); String projectPath = new File(binPath).getParent(); uri = new File(projectPath+"/"+source).toURI(); } return uri; } public void dumpViolations(List<UnsatisfiedConstraint> violations, boolean includeLocation) { for (UnsatisfiedConstraint constraint : violations) { System.out.println(" Validator: " + constraint.getMessage()); Loading