Permalink
Browse files

configuration files may also be in working dir

  • Loading branch information...
1 parent ce1114a commit 8d8646d76796c052d46ec08ec5cef634d62f754e mic committed Feb 22, 2013
Binary file not shown.
@@ -24,6 +24,7 @@
import java.io.File;
import java.io.IOException;
+import java.io.FileInputStream;
import java.io.InputStream;
import java.security.Key;
import java.security.KeyPair;
@@ -63,8 +64,14 @@
static private Properties loadProperties(String file) throws IOException {
// ClassLoader loader = ClassLoader.getSystemClassLoader();
// InputStream is = loader.getResourceAsStream(file);
- InputStream is = Configurations.class.getClassLoader()
+ InputStream is = null;
+ File f = new File(file);
+ if (f.exists()) {
+ is = new FileInputStream(f);
+ } else {
+ is = Configurations.class.getClassLoader()
.getResourceAsStream(file);
+ }
if (is != null) {
Properties properties = new Properties();

0 comments on commit 8d8646d

Please sign in to comment.