[jboss-cvs] JBossAS SVN: r94382 - trunk/server/src/main/java/org/jboss/deployment.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Oct 5 11:31:21 EDT 2009


Author: alesj
Date: 2009-10-05 11:31:21 -0400 (Mon, 05 Oct 2009)
New Revision: 94382

Modified:
   trunk/server/src/main/java/org/jboss/deployment/EarLibExcludeDeployer.java
Log:
Port JBAS-6842.

Modified: trunk/server/src/main/java/org/jboss/deployment/EarLibExcludeDeployer.java
===================================================================
--- trunk/server/src/main/java/org/jboss/deployment/EarLibExcludeDeployer.java	2009-10-05 15:19:35 UTC (rev 94381)
+++ trunk/server/src/main/java/org/jboss/deployment/EarLibExcludeDeployer.java	2009-10-05 15:31:21 UTC (rev 94382)
@@ -30,6 +30,7 @@
 import org.jboss.deployers.vfs.spi.deployer.AbstractSimpleVFSRealDeployer;
 import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
 import org.jboss.metadata.ear.jboss.JBossAppMetaData;
+import org.jboss.virtual.VFS;
 import org.jboss.virtual.VirtualFile;
 
 /**
@@ -71,6 +72,12 @@
 
    /**
     * Do exclude based on url.
+    *
+    * This might not be the best way to check,
+    * as we move up the hierarchy, and if there is no VFS caching
+    * we might not have parent for the first file instance.
+    *
+    * But otoh, by default we should have some VFS caching, which makes this OK.
     */
    private class UrlExcludeResourceFilter implements ResourceFilter
    {
@@ -85,7 +92,22 @@
 
       public boolean accepts(ResourceContext rc)
       {
-         return url.equals(rc.getUrl()) == false;
+         try
+         {
+            VirtualFile file = VFS.getRoot(rc.getUrl());
+            while (file != null)
+            {
+               if (url.equals(file.toURL())) // our parent is the lib
+                  return false;
+
+               file = file.getParent();
+            }
+            return true;
+         }
+         catch (Exception e)
+         {
+            return false;
+         }
       }
    }
 }
\ No newline at end of file




More information about the jboss-cvs-commits mailing list