commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Amitabh Pandey (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CONFIGURATION-700) Issue With backslash(\) and Forwardslash(/)
Date Wed, 09 May 2018 03:58:00 GMT

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

Amitabh Pandey edited comment on CONFIGURATION-700 at 5/9/18 3:57 AM:
----------------------------------------------------------------------

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

. 


was (Author: amitkpandey):
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)

Mime
View raw message