[jboss-cvs] JBossAS SVN: r94369 - branches/Branch_5_x/server/src/main/org/jboss/deployment.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Oct 5 09:56:11 EDT 2009
Author: alesj
Date: 2009-10-05 09:56:11 -0400 (Mon, 05 Oct 2009)
New Revision: 94369
Modified:
branches/Branch_5_x/server/src/main/org/jboss/deployment/EarLibExcludeDeployer.java
Log:
[JBAS-6842]; fix ear lib exclude.
Modified: branches/Branch_5_x/server/src/main/org/jboss/deployment/EarLibExcludeDeployer.java
===================================================================
--- branches/Branch_5_x/server/src/main/org/jboss/deployment/EarLibExcludeDeployer.java 2009-10-05 13:48:15 UTC (rev 94368)
+++ branches/Branch_5_x/server/src/main/org/jboss/deployment/EarLibExcludeDeployer.java 2009-10-05 13:56:11 UTC (rev 94369)
@@ -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