If you do not want to change your configuration file for each OS, what are they intended for?
Each installation should have its own set of configuration files and use it accordingly.
But if you insist, you just need to determine the OS version, and if not Windows, ignore the letter:
Something along the lines of:
boolean isWindows = System.getProperty("os.name")
.toLowerCase().contains("windows");
String folder = "S:";
if( isWindows && folder.matches("\\w:") {
folder = "/";
} else if( isWindows && folder.matches("\\w:.+)) {
folder = folder.substring(2);// ignoring the first two letters S:
}
You get the idea
source
share