commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sabine Schwanitz <sabine.schwan...@aparzev.com>
Subject Re: [configuration] setDelimiterParsingDisabled doesn't work withd DefaultConfigurationBuilder
Date Tue, 02 Oct 2007 09:39:00 GMT
Oliver Heger schrieb:

Hi Oliver,

thanks for responding.
I was already thinking about disabling the mode in the configuration 
file, unfortunately  that does not work:
Here is my complete
config-file:
<properties fileName="ShopMessageResources.properties" 
delimiterParsingDisabled="true"/>
code:

public void testDelimiterDisabled() throws Exception {

        Configuration config = 
ShopPropertiesConfiguration.getShopConfiguration();
        String contents = config.getString("contact.instructions");
        String expected = "Hier haben Sie die Möglichkeit, sich mit uns 
in Verbindung zu setzen.";
        System.out.println(contents);  // this brings "Hier haben Sie 
die Möglichkeit"
        assertNotNull(contents);
        assertEquals(expected, contents);

 }

ShopPropertiesConfiguration:
private static final String shopConfigName = "shop-config.xml";
private static Configuration configuration;

public static Configuration getShopConfiguration() throws Exception {

        if (configuration == null) {
           
            DefaultConfigurationBuilder shopBuilder = new 
DefaultConfigurationBuilder(
                shopConfigName);

            configuration = shopBuilder.getConfiguration();
        }
        return configuration;
    }
}

The only workaround i found now, is using a very rare used unicode as 
delimiter before loading configurations

Sabine
> Sabine,
>
> setting the delimiter parsing disabled flag on the 
> DefaultConfigurationBuilder does not affect the loaded configurations, 
> but only the builder itself. You can disable this mode for the sub 
> configurations in the configuration definition file for each single 
> configuration, e.g.:
>
> <properties filename="test.properties" delimiterParsingDisabled="true"/>
>
> HTH
> Oliver
>

-- 

Sabine Schwanitz
Software Entwicklerin
-------------------------
Aparzev GmbH
Sitz Berlin
Geschäftsführer: Alexander Apartsev
Amtsgericht Charlottenburg, Berlin HR B 90915
Steuernummer 37/244/20791
USt.-Id.-Nr. DE813783738



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message