Skip to content

Commit

Permalink
use local classloader instead of system classloader
Browse files Browse the repository at this point in the history
  • Loading branch information
norbertpotocki committed Jun 19, 2015
1 parent daabaf5 commit 7164f60
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public Properties getConfiguration(Environment environment) {

String pathPrefix = getPrefixFor(environment);

URL url = ClassLoader.getSystemResource(pathPrefix);
URL url = getClass().getClassLoader().getResource(pathPrefix);
if (url == null) {
throw new MissingEnvironmentException("Directory doesn't exist: " + environment.getName());
}
Expand All @@ -91,7 +91,7 @@ public Properties getConfiguration(Environment environment) {
.collect(Collectors.toList());

for (File file : files) {
try (InputStream input = ClassLoader.getSystemResourceAsStream(file.getPath())) {
try (InputStream input = getClass().getClassLoader().getResourceAsStream(file.getPath())) {

if (input == null) {
throw new IllegalStateException("Unable to load properties from classpath: " + file.getPath());
Expand Down

0 comments on commit 7164f60

Please sign in to comment.