Skip to content

Commit

Permalink
fix: environmental variables with . or _
Browse files Browse the repository at this point in the history
  • Loading branch information
lroffia committed Jul 17, 2024
1 parent 6856a5f commit 5929c82
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,10 @@ protected Reader getReaderFromUri(String uri) throws SEPAPropertiesException {
} catch (FileNotFoundException ex) {
Logging.logger.warn("Failed to get file reader: "+ex.getMessage());
Logging.logger.info("Get resource from URI: "+uri);
if (getClass().getClassLoader().getResourceAsStream(uri) == null) {
Logging.logger.fatal("Resource not found: "+uri);
throw new SEPAPropertiesException("Resource not found: "+uri);
}
in = new InputStreamReader(Objects.requireNonNull(getClass().getClassLoader().getResourceAsStream(uri)));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
*/

public class Engine implements EngineMBean {
private final static String version = "v0.15.3";
private final static String version = "v0.15.4";

private EngineProperties properties = null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,9 @@ public EngineProperties(String[] args) throws SEPASecurityException {
try {
endpointProperties = new SPARQL11Properties(endpointJpar);
} catch (SEPAPropertiesException e) {
Logging.logger.error("Endpoint configuration file not found: "+endpointJpar+"USING DEFAULTS: Jena in memory");
endpointProperties = new SPARQL11Properties("in-memory",ProtocolScheme.jena_api);
Logging.logger.fatal("Endpoint configuration file not found: "+endpointJpar);
System.exit(-1);
//endpointProperties = new SPARQL11Properties("in-memory",ProtocolScheme.jena_api);
}

parsingArgument(args);
Expand Down Expand Up @@ -606,6 +607,7 @@ private void parsingArgument(String[] args) throws PatternSyntaxException {
for(String var : envs.keySet()) {
Logging.logger.trace("Environmental variable "+var+" : "+envs.get(var));
setParameter("-"+var, envs.get(var));
setParameter("-"+var.replace("_", "."), envs.get(var));
}
}

Expand Down

0 comments on commit 5929c82

Please sign in to comment.