Uploaded image for project: 'Commons Configuration'
  1. Commons Configuration
  2. CONFIGURATION-130

[configuration] FileConfiguration - Save problem when embedded spaces are in the path

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.1
    • None
    • None
    • None
    • Operating System: Windows XP
      Platform: PC

    • 35210

    Description

      Actual path to file:
      C:/Documents and Settings/chrisw/IdeaProjects/sptech-as400-
      cmretention/classes/com/sptech/CMRetention/configuration.xml

      The configuration file is read correctly without a problem.

      The save operation creates the following directory structure and file:
      C:/Documents%20and%20Settings/chrisw/IdeaProjects/sptech-as400-
      cmretention/classes/com/sptech/CMRetention/configuration.xml

      Here is the code that I was using:

      try

      { URL f = getClass().getResource("cmretention.xml"); XMLConfiguration xml = new XMLConfiguration(f); System.out.println(xml.getString("login.user")); xml.setAutoSave(true); xml.setProperty("login.server",server); xml.setProperty("login.user", user); xml.setProperty("login.password", password); xml.setProperty("paths.library", library); xml.save(); }

      catch (ConfigurationException e)

      { e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. }

      Attachments

        Activity

          People

            Unassigned Unassigned
            chrisw@sptech.com Chris Winterscheid
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: