So I need the client to store the server address etc... locally and also have it encrypted but where should the file be kept as I have tried putting it in the Program Files folder but I am getting an error. It works fine on mac but not windows.
/**
* Gets the path to the configuration file
* dependent on the operating system.
*
* @return File Path {@code File}
*/
public File getOSConfigurationPath () {
File file;
if (System.getProperty("os.name").startsWith("Windows")) {
file = new File (System.getProperty("user.home") + "/Program Files/AutoSales/Configuration.txt");
} else {
file = new File (System.getProperty("user.home") + "/Library/Application Support/AutoSales/Configuration.txt");
}
return file;
}
The file where ^^^^ is returned to uses it like this.
} else {
file.createNewFile();
System.out.println("New Config File Created");
}
For some reason the Windows save path give this error.
Any advice would be greatly appreciated. Thanks.