Fixed classLoader
This commit is contained in:
parent
91c25084cd
commit
4c900e6864
|
@ -31,9 +31,10 @@ public class Constants {
|
||||||
try {
|
try {
|
||||||
if(clientSecret==null) {
|
if(clientSecret==null) {
|
||||||
Properties properties = new Properties();
|
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());
|
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);
|
properties.load(input);
|
||||||
int index = context.indexOf('/', 1);
|
int index = context.indexOf('/', 1);
|
||||||
String root = context.substring(0, index == -1 ? context.length() : index);
|
String root = context.substring(0, index == -1 ? context.length() : index);
|
||||||
|
|
Loading…
Reference in New Issue