Hi all
I have a config file (actually a properties file) but I cannot package it with my jar file as the users need easy access (via text editor) to modify it.
Can you give me a tip on how to specify its location in a portable way. At the moment I'm doing this (file is in same directory as the jar file).
private static
String configFileName = "\\config.properties";
...
String configPathAndFile = System.getProperty("user.dir") +
configFileName;
configProps = new Properties();
try {
// Open the config file.
configFileIs = new FileInputStream(configPathAndFile);
try {
// Load the config properties.
configProps.load(configFileIs);
} catch (IOException ex1) {
// set defaults
}
} catch (FileNotFoundException ex2) {
// set defaults
}