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

Colon in properties file value no longer unescaped in commons configuration 2

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.1.1
    • Component/s: None
    • Labels:
      None

      Description

      A properties file create with java escape a colon in for example a path like
      C:\test as

      C\:\\test

      When reading this property value in commons configuration the colon is unescaped, C:\test

      When reading the property value in commons configuration 2 the colon is no longer unescaped, C\:\test.

      Snipped of the code I used for reading the property

      final ConfigurationBuilder<PropertiesConfiguration> builder =                            new FileBasedConfigurationBuilder<>(PropertiesConfiguration.class).configure(new Parameters().properties().setFile(path.toFile());
      
      final PropertiesConfiguration propertiesConfiguration = builder.getConfiguration();
      Assert.assertEquals("C:\\test", propertiesConfiguration.getString("test2"));
      
      

      I've read this section so I'm aware of the changes to escaping, but I'm not sure how the escaping of the colon fits into this and if there is a way around this.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              tom.byttebier Tom Byttebier
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: