aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/gv/egiz/moazs/util
diff options
context:
space:
mode:
authorChristof Rabensteiner <christof.rabensteiner@iaik.tugraz.at>2019-08-21 15:27:46 +0200
committerChristof Rabensteiner <christof.rabensteiner@iaik.tugraz.at>2019-08-23 14:57:28 +0200
commit763724b04d25d07fce5559c1d7a6c12badab937c (patch)
tree4c980304eccea8181a1ad4d94bcc1bab24423f84 /src/main/java/at/gv/egiz/moazs/util
parentaf9478800e5e9884e690c5a48dce2b68d7d348a2 (diff)
downloadmoa-zs-763724b04d25d07fce5559c1d7a6c12badab937c.tar.gz
moa-zs-763724b04d25d07fce5559c1d7a6c12badab937c.tar.bz2
moa-zs-763724b04d25d07fce5559c1d7a6c12badab937c.zip
Moved Config Files From main/resources/ To test/resources/config
- Reason: Integration tests need configuration, but config files should not be packaged into the final artifact. - Update paths.
Diffstat (limited to 'src/main/java/at/gv/egiz/moazs/util')
-rw-r--r--src/main/java/at/gv/egiz/moazs/util/FileUtils.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/at/gv/egiz/moazs/util/FileUtils.java b/src/main/java/at/gv/egiz/moazs/util/FileUtils.java
index 7e7723d..eb1b291 100644
--- a/src/main/java/at/gv/egiz/moazs/util/FileUtils.java
+++ b/src/main/java/at/gv/egiz/moazs/util/FileUtils.java
@@ -8,7 +8,7 @@ import java.io.File;
public class FileUtils {
/**
- * If path is relative, resolve path as classpath resource. If path is absolute,
+ * If path is relative, try to resolve path as classpath resource. If path is absolute,
* leave as-is.
*/
public String determinePath(String abstractPath) {
@@ -16,7 +16,8 @@ public class FileUtils {
return abstractPath;
} else {
//java.lang.Class needs relative resources to start with "/"
- return this.getClass().getResource("/" + abstractPath).getFile();
+ var resource = this.getClass().getResource("/" + abstractPath);
+ return resource == null ? abstractPath : resource.getFile();
}
}
}