This discussion is archived
4 Replies Latest reply: Mar 25, 2013 8:59 AM by jtahlborn RSS

writing windows path to properties file

mjmjava Newbie
Currently Being Moderated
Hello
I have a code in which i am writing a windows path to property file like this

String installationDirectory = dataBean.getInstallationPath();
          installationDirectory = installationDirectory + "\\Preferences.properties";
          Properties prop = new Properties();
          try {
               prop.setProperty(PropertyClass.getPropertyLabel(Constants.PREFERENCES_PROPERTY_USERNAME),
                         dataBean.getUserName());
               prop.setProperty(PropertyClass.getPropertyLabel(Constants.PREFERENCES_PROPERTY_DOMAIN),
                         dataBean.getDomain());
               prop.setProperty(PropertyClass.getPropertyLabel(Constants.PREFERENCES_PROPERTY_DOCBASE),
                         dataBean.getDocBase());
               prop.setProperty(PropertyClass.getPropertyLabel(Constants.PREFERENCES_PROPERTY_DATE_FORMAT),
                         dataBean.getDateFormat());
               prop.setProperty(PropertyClass.getPropertyLabel(Constants.PREFERENCES_PROPERTY_SERVER_DATE_FORMAT),
                         dataBean.getServerDateFormat());
               prop.setProperty(PropertyClass.getPropertyLabel(Constants.PREFERENCES_PROPERTY_DEFAULT_FOLDER_PATH),
                         dataBean.getCsvFileLocation());
               prop.setProperty(PropertyClass.getPropertyLabel(Constants.PREFERENCES_PROPERTY_DEFAULT_LOG_LOCATION),
                         dataBean.getLogLocation());
               prop.store(new FileOutputStream(installationDirectory), null);

But the value i am getting in property file is something like this

"C\:\\Documents and Settings\\mayur.mitkari\\Desktop\\InstallationWizard\\com\\impact\\qtl12"
why i am getting "c\:"

Regards

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points