Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 36612 invoked from network); 10 Jun 2010 17:43:41 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 10 Jun 2010 17:43:41 -0000 Received: (qmail 61585 invoked by uid 500); 10 Jun 2010 17:43:41 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 61562 invoked by uid 500); 10 Jun 2010 17:43:41 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 61554 invoked by uid 99); 10 Jun 2010 17:43:41 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Jun 2010 17:43:41 +0000 X-ASF-Spam-Status: No, hits=-1137.7 required=10.0 tests=ALL_TRUSTED,AWL X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Jun 2010 17:43:40 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id A74512388993; Thu, 10 Jun 2010 17:42:58 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r953409 - in /harmony/enhanced/java/trunk/classlib/modules/luni/src: main/java/org/apache/harmony/luni/internal/net/www/protocol/jar/ test/api/common/org/apache/harmony/luni/tests/java/net/ test/resources/org/apache/harmony/luni/tests/java/... Date: Thu, 10 Jun 2010 17:42:58 -0000 To: commits@harmony.apache.org From: tellison@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100610174258.A74512388993@eris.apache.org> Author: tellison Date: Thu Jun 10 17:42:58 2010 New Revision: 953409 URL: http://svn.apache.org/viewvc?rev=953409&view=rev Log: Apply slightly modified patch for HARMONY-6537 ([classlib][luni] JarFile can not accept entry name contains special url format) Added: harmony/enhanced/java/trunk/classlib/modules/luni/src/test/resources/org/apache/harmony/luni/tests/java/net/url-test.jar (with props) Modified: harmony/enhanced/java/trunk/classlib/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/jar/JarURLConnectionImpl.java harmony/enhanced/java/trunk/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/JarURLConnectionTest.java Modified: harmony/enhanced/java/trunk/classlib/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/jar/JarURLConnectionImpl.java URL: http://svn.apache.org/viewvc/harmony/enhanced/java/trunk/classlib/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/jar/JarURLConnectionImpl.java?rev=953409&r1=953408&r2=953409&view=diff ============================================================================== --- harmony/enhanced/java/trunk/classlib/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/jar/JarURLConnectionImpl.java (original) +++ harmony/enhanced/java/trunk/classlib/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/jar/JarURLConnectionImpl.java Thu Jun 10 17:42:58 2010 @@ -28,6 +28,7 @@ import java.net.ContentHandlerFactory; import java.net.JarURLConnection; import java.net.MalformedURLException; import java.net.URL; +import java.net.URLDecoder; import java.security.AccessController; import java.security.Permission; import java.security.PrivilegedAction; @@ -207,12 +208,14 @@ public class JarURLConnectionImpl extend * URLConnection}. */ private void findJarEntry() throws IOException { - if (getEntryName() == null) { + String entryName = getEntryName(); + if (entryName == null) { return; } - jarEntry = jarFile.getJarEntry(getEntryName()); + String decodedName = URLDecoder.decode(entryName, "UTF-8"); //$NON-NLS-1$ + jarEntry = jarFile.getJarEntry(decodedName); if (jarEntry == null) { - throw new FileNotFoundException(getEntryName()); + throw new FileNotFoundException(entryName); } } Modified: harmony/enhanced/java/trunk/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/JarURLConnectionTest.java URL: http://svn.apache.org/viewvc/harmony/enhanced/java/trunk/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/JarURLConnectionTest.java?rev=953409&r1=953408&r2=953409&view=diff ============================================================================== --- harmony/enhanced/java/trunk/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/JarURLConnectionTest.java (original) +++ harmony/enhanced/java/trunk/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/JarURLConnectionTest.java Thu Jun 10 17:42:58 2010 @@ -305,6 +305,17 @@ public class JarURLConnectionTest extend "content/unknown", u.openConnection().getContentType()); } + public void test_getURLEncodedEntry() throws IOException { + String base = "file:resources/org/apache/harmony/luni/tests/java/net/url-test.jar"; + URL url = new URL("jar:" + base + "!/test%20folder%20for%20url%20test/test"); + + if (url != null) { + // Force existence check + InputStream is = url.openStream(); + is.close(); + } + } + protected void setUp() { } Added: harmony/enhanced/java/trunk/classlib/modules/luni/src/test/resources/org/apache/harmony/luni/tests/java/net/url-test.jar URL: http://svn.apache.org/viewvc/harmony/enhanced/java/trunk/classlib/modules/luni/src/test/resources/org/apache/harmony/luni/tests/java/net/url-test.jar?rev=953409&view=auto ============================================================================== Binary file - no diff available. Propchange: harmony/enhanced/java/trunk/classlib/modules/luni/src/test/resources/org/apache/harmony/luni/tests/java/net/url-test.jar ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream