Return-Path: X-Original-To: apmail-incubator-ace-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-ace-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 61CAC9877 for ; Tue, 27 Sep 2011 20:34:13 +0000 (UTC) Received: (qmail 58826 invoked by uid 500); 27 Sep 2011 20:34:13 -0000 Delivered-To: apmail-incubator-ace-commits-archive@incubator.apache.org Received: (qmail 58800 invoked by uid 500); 27 Sep 2011 20:34:13 -0000 Mailing-List: contact ace-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ace-dev@incubator.apache.org Delivered-To: mailing list ace-commits@incubator.apache.org Received: (qmail 58787 invoked by uid 99); 27 Sep 2011 20:34:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Sep 2011 20:34:12 +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; Tue, 27 Sep 2011 20:34:11 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id C5BF723888FE; Tue, 27 Sep 2011 20:33:51 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1176601 - /incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/VaadinResourceHandler.java Date: Tue, 27 Sep 2011 20:33:51 -0000 To: ace-commits@incubator.apache.org From: pauls@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20110927203351.C5BF723888FE@eris.apache.org> Author: pauls Date: Tue Sep 27 20:33:51 2011 New Revision: 1176601 URL: http://svn.apache.org/viewvc?rev=1176601&view=rev Log: Use the bundle to look-up resources Modified: incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/VaadinResourceHandler.java Modified: incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/VaadinResourceHandler.java URL: http://svn.apache.org/viewvc/incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/VaadinResourceHandler.java?rev=1176601&r1=1176600&r2=1176601&view=diff ============================================================================== --- incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/VaadinResourceHandler.java (original) +++ incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/VaadinResourceHandler.java Tue Sep 27 20:33:51 2011 @@ -28,10 +28,12 @@ import javax.servlet.http.HttpServletRes import org.osgi.service.http.HttpContext; import org.osgi.service.http.HttpService; import org.osgi.service.http.NamespaceException; +import org.osgi.framework.*; public class VaadinResourceHandler { private volatile HttpService m_http; private HttpContext m_context; + private BundleContext m_bundleContext; public void start() { m_context = m_http.createDefaultHttpContext(); @@ -58,9 +60,9 @@ public class VaadinResourceHandler { if (!name.startsWith("/")) { name = "/" + name; } - if (name.startsWith(prefix)) { + if (name.startsWith(prefix)) { String originalName = name.replace("/ace/", "/reindeer/"); - resource = getClass().getResource(originalName); + resource = m_bundleContext.getBundle().getEntry(originalName); if (resource == null) { // try to find the resource in the Vaadin bundle instead resource = com.vaadin.Application.class.getResource(originalName);