Fixed classLoader

This commit is contained in:
luca.frosini 2023-06-26 16:03:57 +02:00
parent 91c25084cd
commit 4c900e6864
1 changed files with 3 additions and 2 deletions

View File

@ -31,9 +31,10 @@ public class Constants {
try {
if(clientSecret==null) {
Properties properties = new Properties();
URL url = Constants.class.getClassLoader().getResource(CLIENT_SECRET_FILENAME);
ClassLoader classLoader = Constants.class.getClassLoader();
URL url = classLoader.getResource(CLIENT_SECRET_FILENAME);
logger.trace("Going to read {} at {}", CLIENT_SECRET_FILENAME, url.toString());
InputStream input = ClassLoader.getSystemClassLoader().getResourceAsStream(CLIENT_SECRET_FILENAME);
InputStream input = classLoader.getResourceAsStream(CLIENT_SECRET_FILENAME);
properties.load(input);
int index = context.indexOf('/', 1);
String root = context.substring(0, index == -1 ? context.length() : index);