config.properties in /resources is ignored #647
Replies: 3 comments
-
This post has been migrated automatically from the old LITIENGINE forum (2018 - 2022). |
Beta Was this translation helpful? Give feedback.
-
This post has been migrated automatically from the old LITIENGINE forum (2018 - 2022). |
Beta Was this translation helpful? Give feedback.
-
This post has been migrated automatically from the old LITIENGINE forum (2018 - 2022). |
Beta Was this translation helpful? Give feedback.
-
This post has been migrated automatically from the old LITIENGINE forum (2018 - 2022).
Posted: 2019-03-11 14:50:56
User: pma8444 [] (age: 1335 days 🔥; posts: 16)
Greetings
My src folder is structured as follows:
/src /main /java /resources
I'd like to have the config.properties, the info-xml and the game.litidata as well as some other stuff in the resources folder instead of the project-root.
For the info-xml and the .litidata it works, however not for the config.properties.
I believe the problem lies in Configuration.java .loadFromFile()-method:
final File settingsFile = new File(this.getFileName()); try (InputStream settingsStream = FileUtilities.getGameResource(this.getFileName())) { if (!settingsFile.exists() && settingsStream == null || !settingsFile.isFile()) {
With my setup, settingsFile will never exist and a config.properties with default values is created, even though FileUtilites finds my "custom" .properties file within the resources folder.
Would it be possible for you to change this? A simple approach could be to just look for the file and to not create it if not found, simply setting up a default-Properties object.
Beta Was this translation helpful? Give feedback.
All reactions