diff --git a/CHANGELOG.md b/CHANGELOG.md index e2c055c..f0ebff2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log for javapos-config-loader +## 4.0.1 + +- corrected logging output when loading class-path resources (solved GH issue [#11](https://github.com/JavaPOSWorkingGroup/javapos-config-loader/issues/11)) + ## 4.0.0 - jpos.config.DefaultCompositeRegPopulator.load() is throwing more specific IllegalArgument exception instead of RuntimeException diff --git a/build.gradle b/build.gradle index 3bc0c5b..1cf4bff 100644 --- a/build.gradle +++ b/build.gradle @@ -27,7 +27,7 @@ wrapper { def artifactName = 'javapos-config-loader' group='org.javapos' -version='4.0.0' // if version is going to be changed, first add "-SNAPSHOT" to test publishing to MavenCentral's Snapshot repo +version='4.0.1-SNAPSHOT' // if version is going to be changed, first add "-SNAPSHOT" to test publishing to MavenCentral's Snapshot repo /////////////////////////////////////////////////////////////////////////////// diff --git a/src/main/java/jpos/config/simple/xml/JavaxRegPopulator.java b/src/main/java/jpos/config/simple/xml/JavaxRegPopulator.java index 4b61fac..57d0787 100644 --- a/src/main/java/jpos/config/simple/xml/JavaxRegPopulator.java +++ b/src/main/java/jpos/config/simple/xml/JavaxRegPopulator.java @@ -143,8 +143,12 @@ public void load() { @Override public void load(String fileName) { - tracer.println("loading JavaPOS configuration from file " + new File(fileName).getAbsolutePath()); - try (InputStream is = new File(fileName).exists() ? new FileInputStream(fileName) : findFileInClasspath(fileName)) { + File file = new File(fileName); + if (file.exists()) + tracer.println("trying to load JavaPOS configuration from file " + file.getAbsolutePath()); + else + tracer.println("because JavaPOS configuration file '" + fileName + "' does not exist, trying to load it as classpath resource"); + try (InputStream is = file.exists() ? new FileInputStream(fileName) : findFileInClasspath(fileName)) { load(is); } catch (Exception e) { tracer.println("Error while loading populator file Exception.message: " + e.getMessage());