You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Daniel Adrian (JIRA)" <ji...@apache.org> on 2007/05/23 19:22:16 UTC

[jira] Created: (CONFIGURATION-273) Saving with interpolation

Saving with interpolation
-------------------------

                 Key: CONFIGURATION-273
                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-273
             Project: Commons Configuration
          Issue Type: New Feature
    Affects Versions: 1.4
            Reporter: Daniel Adrian


It will be very nice if you'll add the ability to save a configuration file with the interpolation data.
so if my config file is :
my_home=127.0.0.1
my_place=Is ${my_home}

when I save the configuration (let's say with save(true)) it will look like
my_home=127.0.0.1
my_place=Is 127.0.0.1

Thank you!

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (CONFIGURATION-273) Saving with interpolation

Posted by "Emmanuel Bourg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONFIGURATION-273?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12498512 ] 

Emmanuel Bourg commented on CONFIGURATION-273:
----------------------------------------------

Just curious, what is the use case for this feature ? The one I see is to save a PropertiesConfiguration as a standard Properties file to be read by another application not using Commons Configuration.

This can be achieved with ConfigurationConverter.getProperties(config), it performs the interpolation of the variables :

    PropertiesConfiguration config = new PropertiesConfiguration("conf.properties");
    Properties props = ConfigurationConverter.getProperties(config);
    FileOutputStream out = new FileOutputStream("conf2.properties")
    props.save(out, null);
    out.close();



> Saving with interpolation
> -------------------------
>
>                 Key: CONFIGURATION-273
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-273
>             Project: Commons Configuration
>          Issue Type: New Feature
>    Affects Versions: 1.4
>            Reporter: Daniel Adrian
>
> It will be very nice if you'll add the ability to save a configuration file with the interpolation data.
> so if my config file is :
> my_home=127.0.0.1
> my_place=Is ${my_home}
> when I save the configuration (let's say with save(true)) it will look like
> my_home=127.0.0.1
> my_place=Is 127.0.0.1
> Thank you!

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (CONFIGURATION-273) Saving with interpolation

Posted by "Oliver Heger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONFIGURATION-273?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12498503 ] 

Oliver Heger commented on CONFIGURATION-273:
--------------------------------------------

Maybe we could implement this feature in a more generic way: The copy methods in ConfigurationUtils could support an additional mode, in which interpolation is automatically performed for affected properties, so that the resulting configuration only contains properties with resolved variables.

Then you can use arbitrary destination configurations, including file-based configurations, which can be saved later.

For hierarchical configurations this task is a bit more complicated (they are not fully supported by the copy() methods of ConfigurationUtils), but it should be possible, too.

> Saving with interpolation
> -------------------------
>
>                 Key: CONFIGURATION-273
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-273
>             Project: Commons Configuration
>          Issue Type: New Feature
>    Affects Versions: 1.4
>            Reporter: Daniel Adrian
>
> It will be very nice if you'll add the ability to save a configuration file with the interpolation data.
> so if my config file is :
> my_home=127.0.0.1
> my_place=Is ${my_home}
> when I save the configuration (let's say with save(true)) it will look like
> my_home=127.0.0.1
> my_place=Is 127.0.0.1
> Thank you!

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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