Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 50685 invoked from network); 16 Jan 2010 18:11:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 16 Jan 2010 18:11:22 -0000 Received: (qmail 59074 invoked by uid 500); 16 Jan 2010 18:11:21 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 58964 invoked by uid 500); 16 Jan 2010 18:11:21 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 58954 invoked by uid 99); 16 Jan 2010 18:11:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 16 Jan 2010 18:11:21 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of gudnabrsam@gmail.com designates 209.85.221.177 as permitted sender) Received: from [209.85.221.177] (HELO mail-qy0-f177.google.com) (209.85.221.177) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 16 Jan 2010 18:11:13 +0000 Received: by qyk7 with SMTP id 7so1000160qyk.10 for ; Sat, 16 Jan 2010 10:10:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:mime-version:in-reply-to :references:content-type:message-id:content-transfer-encoding:from :subject:date:to:x-mailer; bh=YsG3vVfLOaRyRfUmoD4tFb5dpLivEgbNVYDwrPev8g8=; b=ufc0f9s8OuQOz55JM708TGiqfo1urUGO0JCGMxys96/6FlI19YQf1SPFCpMDwfJO3v V3d8qzBPjbgj3S+eV2n/k5eOLkyvDwZ7VxvGs2TuhZB20c056pFjGe6AcgANeQaKsBXh 6+HUFEb5fWC7/Lv3+tnibJkb2MwdK8n81wZ/E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:content-type:message-id :content-transfer-encoding:from:subject:date:to:x-mailer; b=G4JszfksToLpxDT8DruNEKAEj3IFHCP2KpvF83NGw+tHeGad1S8iLdXMqCqqB2dOYi YJRBF58TsGe3hejormfVQt/vLt7+hGwqc5RH3UJQ258EWCuYuol0CiQqVfqMdNzZNWqo 9SCRFhjlPF3feIa6ah1bZuJWhg7peLnwfYDCI= Received: by 10.224.99.132 with SMTP id u4mr3159677qan.234.1263665451234; Sat, 16 Jan 2010 10:10:51 -0800 (PST) Received: from ?192.168.0.4? ([72.169.48.55]) by mx.google.com with ESMTPS id 23sm2962793qyk.15.2010.01.16.10.10.46 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 16 Jan 2010 10:10:50 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v753.1) In-Reply-To: References: <20100114232648.557FA23889DD@eris.apache.org> <4B4FAA98.9020807@sun.com> <66599455-131C-4AF1-BA6A-6FE1D93FF04B@gmail.com> <5B747351-1B81-4DA2-92FE-32ED4A7C77B7@gmail.com> Content-Type: text/plain; charset=UTF-8; delsp=yes; format=flowed Message-Id: <9601624B-9D70-4FE5-839F-5C495DCAC5BB@gmail.com> Content-Transfer-Encoding: quoted-printable From: Matt Benson Subject: Re: svn commit: r899468 - in /ant/antlibs/props/trunk: docs/index.html src/main/org/apache/ant/props/EncodeURLEvaluator.java src/main/org/apache/ant/props/antlib.xml src/tests/antunit/encodeURL-test.xml Date: Sat, 16 Jan 2010 12:10:55 -0600 To: "Ant Developers List" X-Mailer: Apple Mail (2.753.1) On Jan 15, 2010, at 6:48 PM, Jesse Glick wrote: > Matt Benson wrote: >> Java 5 blows up when call toURI() against a URL with a space =20 >> included. > > Which is correct; such a URL is invalid: > > $ jrunscript > js> new java.net.URL("file:/tmp/foo bar").toURI() > script error: sun.org.mozilla.javascript.internal.WrappedException: =20= > Wrapped java.net.URISyntaxException: Illegal character in path at =20 > index 13: file:/tmp/foo bar (#1) in at line number 1 > js> new java.net.URL("file:/tmp/foo%20bar").toURI() > file:/tmp/foo%20bar > > Maybe I'm missing the purpose of EncodeURLEvaluator, but where =20 > would you get a bogus URL like that from to begin with? Surely not =20 > from on a file, which ought to escape spaces in =20 > filenames. I assumed that the purpose was just to encode non-ASCII =20 > characters, for which toURI is fine: > The main idea here is to allow folk to use URLs containing e.g. =20 spaces that their browser will accept and silently convert for them. > js> new java.net.URL("file:/tmp/foo=C4=8Dbar").toURI().toASCIIString() > file:/tmp/foo%C4%8Dbar > > Or are you trying to encode path sequences (rather than complete =20 > URLs)? But then there is an easier way, without using URL at all: > > js> new java.net.URI(null, "foo bar", null).rawPath > foo%20bar > > Anyway does this belong in Ant 1.8.0 so late in the release cycle? > Ah, but it's not in Ant--it's in the props antlib! -Matt > > --------------------------------------------------------------------- > 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