Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 21900 invoked from network); 7 Nov 2006 15:39:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Nov 2006 15:39:14 -0000 Received: (qmail 64635 invoked by uid 500); 7 Nov 2006 15:39:25 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 64525 invoked by uid 500); 7 Nov 2006 15:39:24 -0000 Mailing-List: contact harmony-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-commits@incubator.apache.org Received: (qmail 64510 invoked by uid 99); 7 Nov 2006 15:39:24 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Nov 2006 07:39:24 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Nov 2006 07:39:12 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 84D1D7142F5 for ; Tue, 7 Nov 2006 07:38:52 -0800 (PST) Message-ID: <23480879.1162913932541.JavaMail.jira@brutus> Date: Tue, 7 Nov 2006 07:38:52 -0800 (PST) From: "Oliver Deakin (JIRA)" To: harmony-commits@incubator.apache.org Subject: [jira] Commented: (HARMONY-2047) [classlib][luni]ClassLoader.getResourceAsStream() fails to get property file with special char in its name In-Reply-To: <17835835.1162460917194.JavaMail.root@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ http://issues.apache.org/jira/browse/HARMONY-2047?page=comments#action_12447832 ] Oliver Deakin commented on HARMONY-2047: ---------------------------------------- Leo, Paulex - do you agree with the above analysis. Perhaps rewriting the FileURLConnection constructor to: public FileURLConnection(URL url) { super(url); fileName = url.getFile(); if (url.getRef() != null) { fileName += "#" + url.getRef(); } if (fileName == null) { fileName = ""; } String host = url.getHost(); if (host != null && host.length() > 0) { fileName = "//" + host + fileName; } fileName = Util.decode(fileName, false); } is the right solution? Any comments? With this modification the provided test passes, and all Harmony Junit tests pass. > [classlib][luni]ClassLoader.getResourceAsStream() fails to get property file with special char in its name > ---------------------------------------------------------------------------------------------------------- > > Key: HARMONY-2047 > URL: http://issues.apache.org/jira/browse/HARMONY-2047 > Project: Harmony > Issue Type: Bug > Reporter: Leo Li > > ClassLoader.getResourceAsStream() fails to get property file with special char in its name. > Here is the testcase: > (First pls put a property file called "AAA#.properties" in where can be searched by classpath.) > public void testGetResourceAsStream() throws Exception > { > InputStream in = TestClassLoader.class.getClassLoader().getResourceAsStream("AAA#.properties"); > assertNotNull(in); > } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira