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

AbstractFileConfiguration.load(String filename) returns with current directory changed

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.6, 1.7
    • Fix Version/s: 1.8
    • Component/s: None
    • Labels:
      None
    • Environment:

      Windows7, Linux (Fedora14)

      Description

          PropertiesConfiguration pc = new PropertiesConfiguration();
          ...
          for (String f : cl.getArgs())
          {
              pc.load(f);
          }
      

      Invoked in directory /home/me/test with several relative paths, i.e. ./sub1/a.cfg ./sub2/b.cfg

      First file loads successfully. Upon return from the first invocation of pc.load(f), the current directory has been changed to the absolute path of the loaded file (/home/me/test/sub1). Thus, subsequent paths given as relative references to the original user.dir fail to be found.

      If this is the expected behavior, it should be documented.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jgarrison@troux.com James Garrison
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: