以下のようにプロパティファイルにFILEPATHパラメータを書き込んでいます。
String newFilePath = txtFilepath.getText();
Properties prop = new Properties();
java.io.File propFile = new File("src/com/app/tool/properties/settings.properties");
prop.setProperty("FILEPATH", newFilePath);
System.out.println("newFilePath "+newFilePath);
try {
prop.store(new FileOutputStream(propFile), "New File location");
} catch (IOException ex) {
ex.printStackTrace();
}
ファイルパスは D:\filelog.txt です
書き込み中、コンソールは次のように出力されます..
newFilePath D:\filelog.txt
しかし、プロパティファイルを開くと、内容は次のようになります..
FILEPATH=D\:\\filelog.txt.
誰か私に提案してください、私が本当にここで何をしているのですか..?