0

If I write to a property file and use a "\" or a ":" java produces a backslash before the character in the property file. I've tried putting a backslash before the character to cancel it out, that doesn't work.

Ex:

props.setProperty("outputFolder", "D:\\src");

This produces D\:\\src in the property file.

Any help would be appreciated, thank you.

  • what is the required string , Please specify that also? – Rishal Aug 05 '16 at 09:30
  • That's how the property file format is defined to work. You can't change that - it wouldn't be a proper propertyfile anymore. See the file format: https://docs.oracle.com/cd/E23095_01/Platform.93/ATGProgGuide/html/s0204propertiesfileformat01.html – Erwin Bolwidt Aug 05 '16 at 09:30

1 Answers1

0

Use this and check you will get what you wanted to store --props.get("outputFolder")

Rishal
  • 1,480
  • 1
  • 11
  • 19