Skip to content

Commit 5929c82

Browse files
committed
fix: environmental variables with . or _
1 parent 6856a5f commit 5929c82

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

client-api/src/main/java/it/unibo/arces/wot/sepa/commons/properties/SPARQL11Properties.java

+4
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,10 @@ protected Reader getReaderFromUri(String uri) throws SEPAPropertiesException {
241241
} catch (FileNotFoundException ex) {
242242
Logging.logger.warn("Failed to get file reader: "+ex.getMessage());
243243
Logging.logger.info("Get resource from URI: "+uri);
244+
if (getClass().getClassLoader().getResourceAsStream(uri) == null) {
245+
Logging.logger.fatal("Resource not found: "+uri);
246+
throw new SEPAPropertiesException("Resource not found: "+uri);
247+
}
244248
in = new InputStreamReader(Objects.requireNonNull(getClass().getClassLoader().getResourceAsStream(uri)));
245249
}
246250
}

engine/src/main/java/it/unibo/arces/wot/sepa/engine/core/Engine.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
*/
4242

4343
public class Engine implements EngineMBean {
44-
private final static String version = "v0.15.3";
44+
private final static String version = "v0.15.4";
4545

4646
private EngineProperties properties = null;
4747

engine/src/main/java/it/unibo/arces/wot/sepa/engine/core/EngineProperties.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,9 @@ public EngineProperties(String[] args) throws SEPASecurityException {
311311
try {
312312
endpointProperties = new SPARQL11Properties(endpointJpar);
313313
} catch (SEPAPropertiesException e) {
314-
Logging.logger.error("Endpoint configuration file not found: "+endpointJpar+"USING DEFAULTS: Jena in memory");
315-
endpointProperties = new SPARQL11Properties("in-memory",ProtocolScheme.jena_api);
314+
Logging.logger.fatal("Endpoint configuration file not found: "+endpointJpar);
315+
System.exit(-1);
316+
//endpointProperties = new SPARQL11Properties("in-memory",ProtocolScheme.jena_api);
316317
}
317318

318319
parsingArgument(args);
@@ -606,6 +607,7 @@ private void parsingArgument(String[] args) throws PatternSyntaxException {
606607
for(String var : envs.keySet()) {
607608
Logging.logger.trace("Environmental variable "+var+" : "+envs.get(var));
608609
setParameter("-"+var, envs.get(var));
610+
setParameter("-"+var.replace("_", "."), envs.get(var));
609611
}
610612
}
611613

0 commit comments

Comments
 (0)