Return-Path: Delivered-To: apmail-felix-commits-archive@www.apache.org Received: (qmail 3546 invoked from network); 9 Feb 2011 15:00:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 9 Feb 2011 15:00:23 -0000 Received: (qmail 72807 invoked by uid 500); 9 Feb 2011 15:00:22 -0000 Delivered-To: apmail-felix-commits-archive@felix.apache.org Received: (qmail 72711 invoked by uid 500); 9 Feb 2011 15:00:19 -0000 Mailing-List: contact commits-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list commits@felix.apache.org Received: (qmail 72699 invoked by uid 99); 9 Feb 2011 15:00:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Feb 2011 15:00:18 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED 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; Wed, 09 Feb 2011 15:00:18 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 21AF523888EC; Wed, 9 Feb 2011 14:59:58 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1068923 - /felix/trunk/framework/src/main/java/org/apache/felix/framework/URLHandlersBundleURLConnection.java Date: Wed, 09 Feb 2011 14:59:58 -0000 To: commits@felix.apache.org From: rickhall@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110209145958.21AF523888EC@eris.apache.org> Author: rickhall Date: Wed Feb 9 14:59:57 2011 New Revision: 1068923 URL: http://svn.apache.org/viewvc?rev=1068923&view=rev Log: Throw exception if anyone attempts to open "/" bundle resource. (FELIX-2832) Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/URLHandlersBundleURLConnection.java Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/URLHandlersBundleURLConnection.java URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/URLHandlersBundleURLConnection.java?rev=1068923&r1=1068922&r2=1068923&view=diff ============================================================================== --- felix/trunk/framework/src/main/java/org/apache/felix/framework/URLHandlersBundleURLConnection.java (original) +++ felix/trunk/framework/src/main/java/org/apache/felix/framework/URLHandlersBundleURLConnection.java Wed Feb 9 14:59:57 2011 @@ -47,6 +47,17 @@ class URLHandlersBundleURLConnection ext throws IOException { super(url); + + // If this is an attempt to create a connection to the root of + // the bundle, then throw an exception since this isn't possible. + // We only allow "/" as a valid URL so it can be used as context + // for creating other URLs. + String path = url.getPath(); + if ((path == null) || (path.length() == 0) || path.equals("/")) + { + throw new IOException("Resource does not exist: " + url); + } + m_framework = framework; // If we don't have a framework instance, try to find