Return-Path: Delivered-To: apmail-cxf-dev-archive@www.apache.org Received: (qmail 66375 invoked from network); 31 Jul 2010 01:50:37 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 31 Jul 2010 01:50:37 -0000 Received: (qmail 88367 invoked by uid 500); 31 Jul 2010 01:50:36 -0000 Delivered-To: apmail-cxf-dev-archive@cxf.apache.org Received: (qmail 88273 invoked by uid 500); 31 Jul 2010 01:50:36 -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 88265 invoked by uid 99); 31 Jul 2010 01:50:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 31 Jul 2010 01:50:35 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of glen.mazza@gmail.com designates 209.85.216.176 as permitted sender) Received: from [209.85.216.176] (HELO mail-qy0-f176.google.com) (209.85.216.176) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 31 Jul 2010 01:50:28 +0000 Received: by qyk34 with SMTP id 34so482737qyk.0 for ; Fri, 30 Jul 2010 18:50:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=1u22qDEflyNhLiD4/ynL8dJiv4wWFwe4epC7CdQ2vio=; b=MR/XHWfaQJ6WGJ2LivOyfQLFTuc3SWWUPTMw0RdibHaBOPZxm+UmX0RAcGS5ZSn3u9 MBgZMV8OhinIsSTalmXjCZZmPgWoGgiVPnB4DBvlYlR+YpKHVveZS+uV1Q58/cctmi+7 XgAacBGpdKo8zKpP/5Hv7+0m/ubxKIgQIiX4M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=tJbjizqL3offC0k/jgtRLxnrZr46d7NCMaBAT0OjKoaaj8TQIqpjLA9tMsD1e3U6j6 FL6bOvFvqBoTgcWMMYmBvdj15ZMLsbiZ8KYRb6lqS0ODu3HswcwtEO1U4GiM+kIj9pg3 5/PJSbr/zXmR56J8aSw1riT930R+wOQJZI4nc= Received: by 10.220.121.202 with SMTP id i10mr1689412vcr.87.1280541006935; Fri, 30 Jul 2010 18:50:06 -0700 (PDT) Received: from [192.168.1.39] (pool-70-17-65-52.res.east.verizon.net [70.17.65.52]) by mx.google.com with ESMTPS id d12sm1055442vcn.14.2010.07.30.18.50.05 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 30 Jul 2010 18:50:06 -0700 (PDT) Message-ID: <4C538151.7020102@gmail.com> Date: Fri, 30 Jul 2010 21:50:09 -0400 From: Glen Mazza User-Agent: Thunderbird 2.0.0.24 (X11/20100317) MIME-Version: 1.0 To: dev@cxf.apache.org Subject: Need for normalization? (Re: svn commit: r980880 - in /cxf/trunk/tools/common/src) References: <20100730160740.AA5DA23889DA@eris.apache.org> In-Reply-To: <20100730160740.AA5DA23889DA@eris.apache.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit 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("\\", "/")); >