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

[configuration] PropertyConfiguration.save() does not take basePath into account

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Nightly Builds
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:

      Operating System: other
      Platform: Other

    • Bugzilla Id:
      30858

      Description

      When using ConfigurationFactory with a config.xml file that contans multiple
      properties files one can iterate through is and get each Configuration. You can
      then use one of these (Typecasting it to the proper type) directly. However,
      when for instance trying to do saveProperty with the PropertiesConfiguration it
      uses the fileName property instead of the basePath (which contains the absolute
      reference) from its superclass. This results in the file being created at
      whatever the current path is, instead of where it actually got the file in the
      first place. Propesed fix is :
      /**

      • Save the configuration to the file specified by the fileName attribute.
        */
        public void save() throws ConfigurationException { // save(fileName); save(getBasePath()); }

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              hermod.opstvedt@dnb.no Hermod Opstvedt
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: