Return-Path: Delivered-To: apmail-cxf-dev-archive@www.apache.org Received: (qmail 61737 invoked from network); 31 Jul 2010 19:59:22 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 31 Jul 2010 19:59:22 -0000 Received: (qmail 37204 invoked by uid 500); 31 Jul 2010 19:59:22 -0000 Delivered-To: apmail-cxf-dev-archive@cxf.apache.org Received: (qmail 37113 invoked by uid 500); 31 Jul 2010 19:59:21 -0000 Mailing-List: contact dev-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list dev@cxf.apache.org Received: (qmail 37105 invoked by uid 99); 31 Jul 2010 19:59:21 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 31 Jul 2010 19:59:21 +0000 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=FREEMAIL_FROM,SPF_HELO_PASS,SPF_NEUTRAL,T_TO_NO_BRKTS_FREEMAIL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: 216.139.236.158 is neither permitted nor denied by domain of glen.mazza@gmail.com) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 31 Jul 2010 19:59:15 +0000 Received: from sam.nabble.com ([192.168.236.26]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1OfICs-00032f-86 for dev@cxf.apache.org; Sat, 31 Jul 2010 12:58:54 -0700 Date: Sat, 31 Jul 2010 12:58:54 -0700 (PDT) From: Glen Mazza To: dev@cxf.apache.org Message-ID: <1280606334243-2260637.post@n5.nabble.com> In-Reply-To: References: <4C538151.7020102@gmail.com> Subject: Re: Need for normalization? (Re: svn commit: r980880 - in /cxf/trunk/tools/common/src) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org What might be a similar issue (https://jaxb.dev.java.net/issues/show_bug.cgi?id=3D774) came up recently o= n 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: >=20 > To chime in: it's a really, really, bad idea for non-file URLs, as it > can violate stringprep. >=20 > 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. >=20 >=20 > On Fri, Jul 30, 2010 at 9:50 PM, Glen Mazza 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= ? >> =C2=A0If the latter, the potential problem I see is that not all URI's a= re >> 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=3D980880&view=3Drev >>> Log: >>> [CXF-2918]:normalize the url like file:/home/cxf/org/apache/../../cxf i= n >>> URIParserUtil.getAbsoluteURL() >>> >>> Modified: >>> >>> =C2=A0cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/UR= IParserUtil.java >>> >>> =C2=A0cxf/trunk/tools/common/src/test/java/org/apache/cxf/tools/util/UR= IParserUtilTest.java >>> >>> Modified: >>> cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/URIParse= rUtil.java >>> URL: >>> http://svn.apache.org/viewvc/cxf/trunk/tools/common/src/main/java/org/a= pache/cxf/tools/util/URIParserUtil.java?rev=3D980880&r1=3D980879&r2=3D98088= 0&view=3Ddiff >>> >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> --- >>> cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/URIParse= rUtil.java >>> (original) >>> +++ >>> cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/URIParse= rUtil.java >>> Fri Jul 30 16:07:40 2010 >>> @@ -248,18 +248,15 @@ public final class URIParserUtil { >>> =C2=A0 =C2=A0 } >>> =C2=A0 =C2=A0 public static String normalize(final String uri) { >>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 URL url =3D null; >>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0String result =3D null; >>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 try { >>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 url =3D new URL(uri); >>> - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return escapeChars(url.toStr= ing().replace("\\", "/")); >>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0result =3D >>> escapeChars(url.toURI().normalize().toString().replace("\\", "/")); >>> >> >> >> >=20 >=20 --=20 View this message in context: http://cxf.547215.n5.nabble.com/Need-for-norm= alization-Re-svn-commit-r980880-in-cxf-trunk-tools-common-src-tp2260268p226= 0637.html Sent from the cxf-dev mailing list archive at Nabble.com.