Fixed classLoader to get a Resource

This commit is contained in:
luca.frosini 2023-06-26 11:24:21 +02:00
parent c29377bc6d
commit 72742086fd
1 changed files with 2 additions and 2 deletions

View File

@ -93,7 +93,7 @@ public class FacetBasedISConfigurationProxy extends ISConfigurationProxy<SimpleF
} }
protected File getBaseDirectory(String directoryName) { protected File getBaseDirectory(String directoryName) {
URL directoryURL = FacetBasedISConfigurationProxy.class.getClassLoader().getResource(directoryName); URL directoryURL = ClassLoader.getSystemClassLoader().getResource(directoryName);
File directory = new File(directoryURL.getPath()); File directory = new File(directoryURL.getPath());
return directory; return directory;
} }
@ -185,7 +185,7 @@ public class FacetBasedISConfigurationProxy extends ISConfigurationProxy<SimpleF
try { try {
queryTemplate = getQueryTemplateFromFile(GET_CALLS_FOR_QUERY_TEMPLATE_FILENAME); queryTemplate = getQueryTemplateFromFile(GET_CALLS_FOR_QUERY_TEMPLATE_FILENAME);
}catch(Exception e) { }catch(Exception e) {
throw new RuntimeException(FacetBasedISConfigurationProxy.class.getSimpleName() + " cannot be used", e); throw new RuntimeException(this.getClass().getSimpleName() + " cannot be used", e);
} }
objectMapper = new ObjectMapper(); objectMapper = new ObjectMapper();
} }