geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r779097 - /geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/BlueprintExtender.java
Date Wed, 27 May 2009 10:34:45 GMT
Author: gnodet
Date: Wed May 27 10:34:45 2009
New Revision: 779097

URL: http://svn.apache.org/viewvc?rev=779097&view=rev
Log:
Fix Blueprint header support for directories

Modified:
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/BlueprintExtender.java

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/BlueprintExtender.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/BlueprintExtender.java?rev=779097&r1=779096&r2=779097&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/BlueprintExtender.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/BlueprintExtender.java
Wed May 27 10:34:45 2009
@@ -125,10 +125,19 @@
         try {
             List<URL> urls = new ArrayList<URL>();
             Dictionary headers = bundle.getHeaders();
-            String blueprintHeader = (String)headers.get(BlueprintConstants.BUNDLE_BLUEPRINT_HEADER);
-            if (blueprintHeader != null) {
-                List<PathElement> paths = HeaderParser.parseHeader(blueprintHeader);
-                for (PathElement path : paths) {
+            String blueprintHeader = (String) headers.get(BlueprintConstants.BUNDLE_BLUEPRINT_HEADER);
+            if (blueprintHeader == null) {
+                blueprintHeader = "OSGI-INF/blueprint/";
+            }
+            List<PathElement> paths = HeaderParser.parseHeader(blueprintHeader);
+            for (PathElement path : paths) {
+                if (path.getName().endsWith("/")) {
+                    Enumeration e = bundle.findEntries(path.getName(), "*.xml", false);
+                    while (e != null && e.hasMoreElements()) {
+                        URL u = (URL) e.nextElement();
+                        urls.add(u);
+                    }
+                } else {
                     URL url = bundle.getEntry(path.getName());
                     if (url != null) {
                         urls.add(url);
@@ -137,18 +146,8 @@
                     }
                 }
             }
-            if (urls.isEmpty()) {
-                Enumeration e = bundle.findEntries("OSGI-INF/blueprint", "*.xml", false);
-                if (e != null) {
-                    while (e.hasMoreElements()) {
-                        URL u = (URL) e.nextElement();
-                        urls.add(u);
-                    }
-                }
-            }
             if (!urls.isEmpty()) {
                 LOGGER.debug("Found blueprint application in bundle {} with urls: {}", bundle.getSymbolicName(),
urls);
-
                 // Check compatibility
                 // TODO: For lazy bundles, the class is either loaded from an imported package
or not found, so it should
                 // not trigger the activation.  If it does, we need to use something else
like package admin or



Mime
View raw message