You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by Glen Mazza <gl...@gmail.com> on 2010/07/31 21:58:54 UTC

Re: Need for normalization? (Re: svn commit: r980880 - in /cxf/trunk/tools/common/src)

What might be a similar issue
(https://jaxb.dev.java.net/issues/show_bug.cgi?id=774) came up recently on
the JAXB issue tracker, I believe the decision there was *not* to normalize;
however, I'm not sure how related Jim's simplification here is to that
issue.

Glen


Benson Margulies wrote:
> 
> To chime in: it's a really, really, bad idea for non-file URLs, as it
> can violate stringprep.
> 
> For file URLs, it is an attempt to deal, with non-NFC (or NFKC)
> strings in the URL failing to match the file system. However, file
> system normalization is platform-dependendent. Linux does none at all,
> for example. So it's not safe in general.
> 
> 
> On Fri, Jul 30, 2010 at 9:50 PM, Glen Mazza <gl...@gmail.com> wrote:
>> May I ask why this normalization is helpful (instead of just using the
>> intended file path to being with)?
>> Does this affect just internal CXF use or external usage by users of CXF?
>>  If the latter, the potential problem I see is that not all URI's are
>> file
>> paths and, even if they were, I'm not sure that you can safely normalize
>> in
>> a platform-independent manner.
>>
>> Glen
>>
>> ema@apache.org wrote:
>>>
>>> Author: ema
>>> Date: Fri Jul 30 16:07:40 2010
>>> New Revision: 980880
>>>
>>> URL: http://svn.apache.org/viewvc?rev=980880&view=rev
>>> Log:
>>> [CXF-2918]:normalize the url like file:/home/cxf/org/apache/../../cxf in
>>> URIParserUtil.getAbsoluteURL()
>>>
>>> Modified:
>>>
>>>  cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/URIParserUtil.java
>>>
>>>  cxf/trunk/tools/common/src/test/java/org/apache/cxf/tools/util/URIParserUtilTest.java
>>>
>>> Modified:
>>> cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/URIParserUtil.java
>>> URL:
>>> http://svn.apache.org/viewvc/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/URIParserUtil.java?rev=980880&r1=980879&r2=980880&view=diff
>>>
>>> ==============================================================================
>>> ---
>>> cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/URIParserUtil.java
>>> (original)
>>> +++
>>> cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/URIParserUtil.java
>>> Fri Jul 30 16:07:40 2010
>>> @@ -248,18 +248,15 @@ public final class URIParserUtil {
>>>     }
>>>     public static String normalize(final String uri) {
>>>         URL url = null;
>>> +        String result = null;
>>>         try {
>>>             url = new URL(uri);
>>> -            return escapeChars(url.toString().replace("\\", "/"));
>>> +            result =
>>> escapeChars(url.toURI().normalize().toString().replace("\\", "/"));
>>>
>>
>>
>>
> 
> 

-- 
View this message in context: http://cxf.547215.n5.nabble.com/Need-for-normalization-Re-svn-commit-r980880-in-cxf-trunk-tools-common-src-tp2260268p2260637.html
Sent from the cxf-dev mailing list archive at Nabble.com.