1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 00:17:11 -07:00

For development: look up kobalt.properties locally if not found in the class loader.

This commit is contained in:
Cedric Beust 2015-11-13 23:27:09 -08:00
parent c986fc6d65
commit bc0eac0d0a

View file

@ -57,7 +57,18 @@ public class Main {
if (url != null) {
readProperties(result, url.openConnection().getInputStream());
} else {
throw new IllegalArgumentException("Couldn't find " + KOBALT_PROPERTIES);
File file = new File("src/main/resources/kobalt.properties");
if (file.exists()) {
FileInputStream fis = null;
try {
fis = new FileInputStream(file);
readProperties(result, fis);
} finally {
if (fis != null) fis.close();
}
} else {
throw new IllegalArgumentException("Couldn't find " + KOBALT_PROPERTIES);
}
}
return result;
}