Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 82759 invoked from network); 4 Apr 2004 10:34:32 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 4 Apr 2004 10:34:32 -0000 Received: (qmail 84134 invoked by uid 500); 4 Apr 2004 10:34:29 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 84039 invoked by uid 500); 4 Apr 2004 10:34:29 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 84021 invoked from network); 4 Apr 2004 10:34:28 -0000 Received: from unknown (HELO moutng.kundenserver.de) (212.227.126.185) by daedalus.apache.org with SMTP; 4 Apr 2004 10:34:28 -0000 Received: from [212.227.126.206] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 1BA4xP-0000HF-00 for dev@ant.apache.org; Sun, 04 Apr 2004 12:34:27 +0200 Received: from [80.128.236.84] (helo=ENITSYSMOB0001) by mrelayng.kundenserver.de with asmtp (Exim 3.35 #1) id 1BA4xP-0005NT-00 for dev@ant.apache.org; Sun, 04 Apr 2004 12:34:27 +0200 Reply-To: From: "Rainer Noack" To: "'Ant Developers List'" Subject: RE: cvs commit: ant/src/main/org/apache/tools/ant/launch Locator.java Date: Sun, 4 Apr 2004 12:34:38 +0200 Message-ID: <000101c41a30$6f40da10$037ba8c0@ENITSYSMOB0001> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.4510 Importance: Normal In-Reply-To: <20040403193143.46754.qmail@web20413.mail.yahoo.com> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Provags-ID: kundenserver.de abuse@kundenserver.de auth:a278c2346575d530eb0d775cc9a340ba X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi Matt, another point: URL.getPath() has been introduced in jdk 1.3 but maybe you can use URL.getFile() instead. Regards, Rainer > -----Original Message----- > From: Matt Benson [mailto:gudnabrsam@yahoo.com] > Sent: Saturday, April 03, 2004 9:32 PM > To: Ant Developers List > Subject: Re: cvs commit: > ant/src/main/org/apache/tools/ant/launch Locator.java > > > Good point. I'll alter that. :) > > -Matt > > --- Martijn Kruithof > wrote: > > mbenson@apache.org wrote: > > > > > > > > 1.12 +12 -7 > > > ant/src/main/org/apache/tools/ant/launch/Locator.java > > > > > > Index: Locator.java > > > > > > =================================================================== > > > RCS file: > > > /home/cvs/ant/src/main/org/apache/tools/ant/launch/Locator.java,v > > > retrieving revision 1.11 > > > retrieving revision 1.12 > > > diff -u -r1.11 -r1.12 > > > --- Locator.java 9 Mar 2004 16:48:03 -0000 1.11 > > > +++ Locator.java 2 Apr 2004 20:20:43 -0000 1.12 > > > @@ -101,13 +101,18 @@ > > > * @since Ant 1.6 > > > */ > > > public static String fromURI(String uri) { > > > - if (!uri.startsWith("file:")) { > > > - throw new > > IllegalArgumentException("Can only handle file: > > URIs"); > > > - } > > > - if (uri.startsWith("file://")) { > > > - uri = uri.substring(7); > > > - } else { > > > - uri = uri.substring(5); > > > + try { > > > + URL url = new URL(uri); > > > + if > > (!("file".equals(url.getProtocol()))) { > > > + throw new > > IllegalArgumentException("Can only handle file: > > URIs"); > > > + } > > > + StringBuffer buf = new > > StringBuffer(url.getHost()); > > > + if (buf.length() > 0) { > > > + buf.insert(0, "//"); > > > + } > > > + buf.append(url.getPath()); > > > + uri = buf.toString(); > > > + } catch (MalformedURLException > > emYouEarlEx) { > > > } > > > > > > uri = uri.replace('/', > > File.separatorChar); > > > > > > > > > > > This is funny, If the URL isn't a file URL we throw > > an > > IllegalArgumentException, but if the URL isn't a > > valid URL at all we > > just continue? (Without removing the file:(//) which > > could have been in > > front, which would have been removed before?) > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: > > dev-unsubscribe@ant.apache.org > > For additional commands, e-mail: > > dev-help@ant.apache.org > > > > > __________________________________ > Do you Yahoo!? > Yahoo! Small Business $15K Web Design Giveaway > http://promotions.yahoo.com/design_giveaway/ > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org > For additional commands, e-mail: dev-help@ant.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org