0

I am developing my Enterprise Application Project in Windows with Eclipse and a local server like XAMPP.

To load a config from a filesystem (outside deployment folder), I use:

String dataOrdner = System.getProperty("jboss.server.data.dir");
BufferedInputStream stream = new BufferedInputStream(new FileInputStream(dataOrdner 
+ File.separator + "configuration.properties"));
properties.load(stream);

This works fine in Windows. I need to deploy my .war to a linux server.
In Linux occurs a FileNotFoundException with following Path:

/serv/wildfly/standalone/data\configuration.properties

Apparently, the seperator does not change during the deployment.

What are best practices for my usecase and how can I fix this problem?

alexander
  • 1,191
  • 2
  • 20
  • 40

1 Answers1

1

Use / always. It works on all systems.

agad
  • 2,192
  • 1
  • 20
  • 32