[ 
https://issues.apache.org/jira/browse/CONFIGURATION-700?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16468289#comment-16468289
 ] 

Amitabh Pandey commented on CONFIGURATION-700:
----------------------------------------------

Hi Heger,Thanks for the reply.As per your suggestion I have used 
commons-configuration2-2.0.jar jar.

Now found one of my issue has been resolved. Now slash is coming properly after 
modification.

Thanks for this.

Here is my code which I am using

FileBasedConfigurationBuilder<PropertiesConfiguration> 
{color:#6a3e3e}builder{color} = *{color:#7f0055}new{color}* 
FileBasedConfigurationBuilder<PropertiesConfiguration>(

 PropertiesConfiguration.*{color:#7f0055}class{color}*)

 .configure(*{color:#7f0055}new{color}* 
Parameters().properties().setFileName({color:#2a00ff}"Test.properties"{color})

 .setThrowExceptionOnMissing(*{color:#7f0055}true{color}*));

 PropertiesConfiguration {color:#6a3e3e}config{color} = 
{color:#6a3e3e}builder{color}.getConfiguration();

{color:#6a3e3e}config{color}.setProperty({color:#2a00ff}"Id"{color}, 
{color:#2a00ff}"3"{color});

{color:#6a3e3e}builder{color}.save();

 System.*_{color:#0000c0}out{color}_*.println({color:#2a00ff}"config.properties 
updated Successfully!!"{color});

Now still one issue is pending of backslash.Now it is not removing as 
previously but it is getting converted in two backslash. Below is the sample

*Before:  C\:ABC.net/wsdl*

*After updation*

*C\\:ABC.net/wsdl***

Please let me know if there is any fix for this also as we have already escaped 
value in property file with \.

So it should not be change after any other value in property file.

Thanks

. 

> Issue With backslash(\) and Forwardslash(/)
> -------------------------------------------
>
>                 Key: CONFIGURATION-700
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-700
>             Project: Commons Configuration
>          Issue Type: Bug
>          Components: Build
>    Affects Versions: 1.10
>            Reporter: Amitabh Pandey
>            Priority: Major
>             Fix For: 1.10
>
>
> Dear Team,
> I am using commons-configuration-1.10.jar for updating property file in java.
> I have achieve all my requirement(Preserve comment, White space) with this 
> API.But stuck at one point.It is not working as per my expectations with 
> slash.Below is one example.
> I have below url in my properties file.
> *C\:ABC.net/wsdl*
> Now it is getting change to below after modification
> *C:ABC.net\/wsdl*
> Means it is removing the backslash and changing forwardslash to \/.I know it 
> is escaping character. But is there any way to prevent this. I cant not 
> change any thing in property file. I have to handle through code only. 
> Because of only this issue I again moved to Java util API.
> Please check fix of this. Rest is excellent.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to