Move config to root
This commit is contained in:
parent
c3272ad9ac
commit
143898753e
2 changed files with 3 additions and 4 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -39,8 +39,8 @@ build/
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
### Other Stuff ###
|
### Other Stuff ###
|
||||||
**/resources/config*.json
|
config*.json
|
||||||
!**/resources/config.example.json
|
config.example.json
|
||||||
!**/resources/config.schema.json
|
!**/resources/config.schema.json
|
||||||
|
|
||||||
### why would this not be here already ###
|
### why would this not be here already ###
|
||||||
|
|
|
@ -22,8 +22,7 @@ public class Config {
|
||||||
*/
|
*/
|
||||||
public static Config readConfig() throws IOException {
|
public static Config readConfig() throws IOException {
|
||||||
Logger log = Logging.getLogger();
|
Logger log = Logging.getLogger();
|
||||||
try (InputStream in=Thread.currentThread().getContextClassLoader().getResourceAsStream("config.json")) {
|
try (InputStream in = new FileInputStream("./config.json")) {
|
||||||
assert in != null;
|
|
||||||
Reader reader = new InputStreamReader(in, StandardCharsets.UTF_8);
|
Reader reader = new InputStreamReader(in, StandardCharsets.UTF_8);
|
||||||
log.info("Loaded config");
|
log.info("Loaded config");
|
||||||
return new Gson().fromJson(reader, Config.class);
|
return new Gson().fromJson(reader, Config.class);
|
||||||
|
|
Loading…
Reference in a new issue