[
https://issues.apache.org/jira/browse/CONFIGURATION-700?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16467910#comment-16467910
]
Oliver Heger commented on CONFIGURATION-700:
--------------------------------------------
Regarding the backslash: This is a limitation of Java properties files. Commons
Configuration behaves here in the same way as
[Properties.load()|[https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html#load-java.io.Reader-|https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html#load-java.io.Reader-.]].
Please have a look at the Javadocs of this method. Basically, you have to
duplicate the backslash in order to correctly escape it.
Regarding the slash: I remeber that older versions of Commons Configuration had
issues with the handling of slashes and escapes. You did not show the code how
the properties file was manipulated. As it is unlikely that there will be
another release of the Configuration 1.x series, I can only recommend to
upgrade to the most recent 2.x version. However, this version is not
API-compatible with Configuration 1.10; so you will have to adapt your code.
Refer to [this
guide|http://commons.apache.org/proper/commons-configuration/userguide/upgradeto2_0.html].
> 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)