-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Properties file location #5
Comments
Hi @saprophagist, I think it may be useful if the user specifies with a custom Java property the path of the property file. |
You can now set your property file with |
@saprophagist You can also set that property dynamically in your code (so your users don't have to use the command-line argument) like this (make sure to replace String configurationFileName = Objects.requireNonNull(MyCoolApp.class.getResource("psw4j.properties")).getFile();
File configurationFile = new File(configurationFileName);
System.setProperty("psw4j.configuration", configurationFile.getAbsolutePath()); This does the exact same as declaring the property via the command line. (See the PropertyReader for more info.) @firaja I strongly suggest to add this piece of information to the project's wiki. |
Describe the bug
If developing out of maven and project structure is not "/src/main/resources/.." properties file can't be found. Also can't set path manually.
To Reproduce
Develop a simple application with Netbeans (Ant build) and try to run.
Expected behavior
Load properties as defined in properties file.
Environment:
Additional context
Project structure:
|
|
|
(etc.)
The text was updated successfully, but these errors were encountered: