[jboss-cvs] JBossAS SVN: r57256 - in projects/microcontainer/trunk: container/src/main/org/jboss/virtual container/src/main/org/jboss/virtual/plugins/context container/src/main/org/jboss/virtual/plugins/context/file container/src/main/org/jboss/virtual/plugins/context/jar container/src/main/org/jboss/virtual/plugins/vfs/helpers container/src/main/org/jboss/virtual/spi container/src/tests/org/jboss/test/virtual/support container/src/tests/org/jboss/test/virtual/test deployers/src/main/org/jboss/deployers/plugins/deployment deployers/src/main/org/jboss/deployers/plugins/structure deployers/src/main/org/jboss/deployers/plugins/structure/vfs deployers/src/main/org/jboss/deployers/plugins/structure/vfs/file deployers/src/main/org/jboss/deployers/plugins/structure/vfs/jar deployers/src/main/org/jboss/deployers/plugins/structure/vfs/war
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Sep 28 05:49:58 EDT 2006
Author: adrian at jboss.org
Date: 2006-09-28 05:49:20 -0400 (Thu, 28 Sep 2006)
New Revision: 57256
Added:
projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/support/MockURLStreamHandler.java
Modified:
projects/microcontainer/trunk/container/src/main/org/jboss/virtual/VFS.java
projects/microcontainer/trunk/container/src/main/org/jboss/virtual/VirtualFile.java
projects/microcontainer/trunk/container/src/main/org/jboss/virtual/VisitorAttributes.java
projects/microcontainer/trunk/container/src/main/org/jboss/virtual/plugins/context/AbstractURIHandler.java
projects/microcontainer/trunk/container/src/main/org/jboss/virtual/plugins/context/AbstractURLHandler.java
projects/microcontainer/trunk/container/src/main/org/jboss/virtual/plugins/context/AbstractVFSContext.java
projects/microcontainer/trunk/container/src/main/org/jboss/virtual/plugins/context/AbstractVirtualFileHandler.java
projects/microcontainer/trunk/container/src/main/org/jboss/virtual/plugins/context/DelegatingHandler.java
projects/microcontainer/trunk/container/src/main/org/jboss/virtual/plugins/context/file/FileHandler.java
projects/microcontainer/trunk/container/src/main/org/jboss/virtual/plugins/context/file/LinkHandler.java
projects/microcontainer/trunk/container/src/main/org/jboss/virtual/plugins/context/jar/AbstractJarHandler.java
projects/microcontainer/trunk/container/src/main/org/jboss/virtual/plugins/context/jar/JarEntryHandler.java
projects/microcontainer/trunk/container/src/main/org/jboss/virtual/plugins/context/jar/NestedJarFromStream.java
projects/microcontainer/trunk/container/src/main/org/jboss/virtual/plugins/vfs/helpers/SuffixMatchFilter.java
projects/microcontainer/trunk/container/src/main/org/jboss/virtual/spi/VirtualFileHandler.java
projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/support/AbstractMockVirtualFileHandler.java
projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/support/MockVFSContext.java
projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/support/MockVFSContextFactory.java
projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/test/FileVFSUnitTestCase.java
projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/test/VFSUnitTestCase.java
projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/test/VirtualFileUnitTestCase.java
projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/deployment/MainDeployerImpl.java
projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/structure/AbstractDeploymentContext.java
projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/structure/MetaDataMatchFilter.java
projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/structure/vfs/CandidateStructureVisitor.java
projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/structure/vfs/file/FileStructure.java
projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/structure/vfs/jar/JARStructure.java
projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/structure/vfs/war/WARStructure.java
projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/structure/vfs/war/WebInfLibFilter.java
Log:
* Rework the VirtualFile isFile()/isDirectory()/isArchive()
There is now isLeaf() which means it cannot contain children,
and isArchive() has been fixed to mean, it is either a real archive
or a directory structure pretending to be an archive.
* Update the VisitorAttributes to remove the direct notion of
directories. Also modified the class such that all the defaults
are false, which should avoid confusion.
* Implemented simple tests of URL based VFS construction.
Modified: projects/microcontainer/trunk/container/src/main/org/jboss/virtual/VFS.java
===================================================================
--- projects/microcontainer/trunk/container/src/main/org/jboss/virtual/VFS.java 2006-09-28 03:17:27 UTC (rev 57255)
+++ projects/microcontainer/trunk/container/src/main/org/jboss/virtual/VFS.java 2006-09-28 09:49:20 UTC (rev 57256)
@@ -200,7 +200,7 @@
*
* @return the children
* @throws IOException for any problem accessing the virtual file system
- * @throws IllegalStateException if the root is not a directory
+ * @throws IllegalStateException if the root is a leaf node
*/
public List<VirtualFile> getChildren() throws IOException
{
@@ -213,7 +213,7 @@
* @param filter to filter the children
* @return the children
* @throws IOException for any problem accessing the virtual file system
- * @throws IllegalStateException if the root is not a directory
+ * @throws IllegalStateException if the root is a leaf node
*/
public List<VirtualFile> getChildren(VirtualFileFilter filter) throws IOException
{
@@ -223,11 +223,11 @@
/**
* Get all the children recursively<p>
*
- * This always uses {@link VisitorAttributes#RECURSE_DIRECTORIES}
+ * This always uses {@link VisitorAttributes#RECURSE}
*
* @return the children
* @throws IOException for any problem accessing the virtual file system
- * @throws IllegalStateException if the root is not a directory
+ * @throws IllegalStateException if the root is a leaf node
*/
public List<VirtualFile> getChildrenRecursively() throws IOException
{
@@ -237,12 +237,12 @@
/**
* Get all the children recursively<p>
*
- * This always uses {@link VisitorAttributes#RECURSE_DIRECTORIES}
+ * This always uses {@link VisitorAttributes#RECURSE}
*
* @param filter to filter the children
* @return the children
* @throws IOException for any problem accessing the virtual file system
- * @throws IllegalStateException if the root is not a directory
+ * @throws IllegalStateException if the root is a leaf node
*/
public List<VirtualFile> getChildrenRecursively(VirtualFileFilter filter) throws IOException
{
@@ -255,13 +255,14 @@
* @param visitor the visitor
* @throws IOException for any problem accessing the VFS
* @throws IllegalArgumentException if the visitor is null
- * @throws IllegalStateException if the root is not a directory
+ * @throws IllegalStateException if the root is a leaf node
*/
public void visit(VirtualFileVisitor visitor) throws IOException
{
VirtualFileHandler handler = context.getRoot();
- if (handler.isDirectory() == false)
- throw new IllegalStateException("Not a directory");
+ if (handler.isLeaf())
+ throw new IllegalStateException("File cannot contain children: " + handler);
+
WrappingVirtualFileHandlerVisitor wrapper = new WrappingVirtualFileHandlerVisitor(visitor);
context.visit(handler, wrapper);
}
@@ -273,7 +274,7 @@
* @param visitor the visitor
* @throws IOException for any problem accessing the VFS
* @throws IllegalArgumentException if the file or visitor is null
- * @throws IllegalStateException if the root is not a directory
+ * @throws IllegalStateException if the root is a leaf node
*/
protected void visit(VirtualFile file, VirtualFileVisitor visitor) throws IOException
{
Modified: projects/microcontainer/trunk/container/src/main/org/jboss/virtual/VirtualFile.java
===================================================================
--- projects/microcontainer/trunk/container/src/main/org/jboss/virtual/VirtualFile.java 2006-09-28 03:17:27 UTC (rev 57255)
+++ projects/microcontainer/trunk/container/src/main/org/jboss/virtual/VirtualFile.java 2006-09-28 09:49:20 UTC (rev 57256)
@@ -157,31 +157,22 @@
}
/**
- * Whether it is a directory
+ * Whether it is a simple leaf of the VFS,
+ * i.e. whether it can contain other files
*
- * @return true if a directory.
- * @throws IOException for any problem accessing the virtual file system
- * @throws IllegalStateException if the file is closed
- */
- public boolean isDirectory() throws IOException
- {
- return getHandler().isDirectory();
- }
-
- /**
- * Whether it is a simple file
- *
* @return true if a simple file.
* @throws IOException for any problem accessing the virtual file system
* @throws IllegalStateException if the file is closed
*/
- public boolean isFile() throws IOException
+ public boolean isLeaf() throws IOException
{
- return getHandler().isFile();
+ return getHandler().isLeaf();
}
/**
- * Whether it is an archive
+ * Whether it is an archive<p>
+ *
+ * NOTE: a file system directory can be an archive if it looks like an unpacked archive
*
* @return true when an archive
* @throws IOException for any problem accessing the virtual file system
@@ -297,12 +288,12 @@
* @param filter to filter the children
* @return the children
* @throws IOException for any problem accessing the virtual file system
- * @throws IllegalStateException if the file is closed or it is not a directory
+ * @throws IllegalStateException if the file is closed or it is a leaf node
*/
public List<VirtualFile> getChildren(VirtualFileFilter filter) throws IOException
{
- if (isDirectory() == false)
- throw new IllegalStateException("Not a directory: " + this);
+ if (isLeaf())
+ throw new IllegalStateException("File cannot contain children: " + this);
if (filter == null)
filter = MatchAllVirtualFileFilter.INSTANCE;
@@ -314,7 +305,7 @@
/**
* Get all the children recursively<p>
*
- * This always uses {@link VisitorAttributes#RECURSE_DIRECTORIES}
+ * This always uses {@link VisitorAttributes#RECURSE}
*
* @return the children
* @throws IOException for any problem accessing the virtual file system
@@ -328,21 +319,21 @@
/**
* Get all the children recursively<p>
*
- * This always uses {@link VisitorAttributes#RECURSE_DIRECTORIES}
+ * This always uses {@link VisitorAttributes#RECURSE}
*
* @param filter to filter the children
* @return the children
* @throws IOException for any problem accessing the virtual file system
- * @throws IllegalStateException if the file is closed or it is not a directory
+ * @throws IllegalStateException if the file is closed or it is a leaf node
*/
public List<VirtualFile> getChildrenRecursively(VirtualFileFilter filter) throws IOException
{
- if (isDirectory() == false)
- throw new IllegalStateException("Not a directory: " + this);
+ if (isLeaf())
+ throw new IllegalStateException("File cannot contain children: " + this);
if (filter == null)
filter = MatchAllVirtualFileFilter.INSTANCE;
- FilterVirtualFileVisitor visitor = new FilterVirtualFileVisitor(filter, VisitorAttributes.RECURSE_DIRECTORIES);
+ FilterVirtualFileVisitor visitor = new FilterVirtualFileVisitor(filter, VisitorAttributes.RECURSE);
visit(visitor);
return visitor.getMatched();
}
@@ -353,12 +344,13 @@
* @param visitor the visitor
* @throws IOException for any problem accessing the virtual file system
* @throws IllegalArgumentException if the visitor is null
- * @throws IllegalStateException if the file is closed or it is not a directory
+ * @throws IllegalStateException if the file is closed or it is a leaf node
*/
public void visit(VirtualFileVisitor visitor) throws IOException
{
- if (isDirectory() == false)
- throw new IllegalStateException("Not a directory: " + this);
+ if (isLeaf())
+ throw new IllegalStateException("File cannot contain children: " + this);
+
getVFS().visit(this, visitor);
}
@@ -369,13 +361,14 @@
* @return the child
* @throws IOException for any problem accessing the VFS (including the child does not exist)
* @throws IllegalArgumentException if the path is null
- * @throws IllegalStateException if the file is closed or it is not a directory
+ * @throws IllegalStateException if the file is closed or it is a leaf node
*/
public VirtualFile findChild(String path) throws IOException
{
VirtualFileHandler handler = getHandler();
- if (handler.isDirectory() == false)
- throw new IllegalStateException("Not a directory: " + this);
+
+ if (handler.isLeaf())
+ throw new IllegalStateException("File cannot contain children: " + this);
path = VFSUtils.fixName(path);
VirtualFileHandler child = handler.findChild(path);
Modified: projects/microcontainer/trunk/container/src/main/org/jboss/virtual/VisitorAttributes.java
===================================================================
--- projects/microcontainer/trunk/container/src/main/org/jboss/virtual/VisitorAttributes.java 2006-09-28 03:17:27 UTC (rev 57255)
+++ projects/microcontainer/trunk/container/src/main/org/jboss/virtual/VisitorAttributes.java 2006-09-28 09:49:20 UTC (rev 57256)
@@ -32,74 +32,74 @@
/** The default attributes */
public static final VisitorAttributes DEFAULT = new ImmutableVisitorAttributes();
- /** No directories */
- public static final VisitorAttributes NO_DIRECTORIES = new ImmutableVisitorAttributes(false, false);
+ /** Leaves only */
+ public static final VisitorAttributes LEAVES_ONLY = new ImmutableVisitorAttributes(true, false);
- /** Recurse directories */
- public static final VisitorAttributes RECURSE_DIRECTORIES = new ImmutableVisitorAttributes(true, true);
+ /** Recurse */
+ public static final VisitorAttributes RECURSE = new ImmutableVisitorAttributes(false, true);
- /** Recurse but don't visit directories */
- public static final VisitorAttributes RECURSE_NO_DIRECTORIES = new ImmutableVisitorAttributes(false, true);
+ /** Recurse but only visit leaves */
+ public static final VisitorAttributes RECURSE_LEAVES_ONLY = new ImmutableVisitorAttributes(true, true);
/** Whether to include the root */
private boolean includeRoot = false;
- /** Whether to include directories */
- private boolean includeDirectories = true;
+ /** Whether to only visit leaves */
+ private boolean leavesOnly = false;
- /** Whether to recurse directories */
- private boolean recurseDirectories = false;
+ /** Whether to recurse */
+ private boolean recurse = false;
/** Whether to ignore individual file errors */
private boolean ignoreErrors = false;
- /** Whether to ignore hidden files */
- private boolean ignoreHidden = true;
+ /** Whether to include hidden files */
+ private boolean includeHidden = false;
/**
- * Whether to include the directories<p>
+ * Whether to visit leaves only<p>
*
- * Default: true
+ * Default: false
*
- * @return the includeDirectories.
+ * @return the visit leaves only.
*/
- public boolean isIncludeDirectories()
+ public boolean isLeavesOnly()
{
- return includeDirectories;
+ return leavesOnly;
}
/**
- * Set the includeDirectories.
+ * Set the leaves only.
*
- * @param includeDirectories the includeDirectories.
+ * @param leavesOnly the leaves only
* @throws IllegalStateException if you attempt to modify one of the preconfigured static values of this class
*/
- public void setIncludeDirectories(boolean includeDirectories)
+ public void setLeavesOnly(boolean leavesOnly)
{
- this.includeDirectories = includeDirectories;
+ this.leavesOnly = leavesOnly;
}
/**
- * Whether to recurse into directories<p>
+ * Whether to recurse<p>
*
* Default: false
*
- * @return the recurseDirectories.
+ * @return the recurse.
*/
- public boolean isRecurseDirectories()
+ public boolean isRecurse()
{
- return recurseDirectories;
+ return recurse;
}
/**
- * Set the recurseDirectories.
+ * Set the recurse.
*
- * @param recurseDirectories the recurseDirectories.
+ * @param recurse the recurse.
* @throws IllegalStateException if you attempt to modify one of the preconfigured static values of this class
*/
- public void setRecurseDirectories(boolean recurseDirectories)
+ public void setRecurse(boolean recurse)
{
- this.recurseDirectories = recurseDirectories;
+ this.recurse = recurse;
}
/**
@@ -128,7 +128,7 @@
/**
* Whether to ignore individual errors<p>
*
- * Default: true
+ * Default: false
*
* @return the ignoreErrors.
*/
@@ -149,26 +149,26 @@
}
/**
- * Whether to ignore hidden files<p>
+ * Whether to include hidden files<p>
*
- * Default: true
+ * Default: false
*
- * @return the ignoreHidden.
+ * @return the includeHidden.
*/
- public boolean isIgnoreHidden()
+ public boolean isIncludeHidden()
{
- return ignoreHidden;
+ return includeHidden;
}
/**
- * Set the ignoreHidden.
+ * Set the includeHidden.
*
- * @param ignoreHidden the ignoreHidden.
+ * @param includeHidden the includeHidden.
* @throws IllegalStateException if you attempt to modify one of the preconfigured static values of this class
*/
- public void setIgnoreHidden(boolean ignoreHidden)
+ public void setIncludeHidden(boolean includeHidden)
{
- this.ignoreHidden = ignoreHidden;
+ this.includeHidden = includeHidden;
}
/**
@@ -186,17 +186,17 @@
/**
* Create a new ImmutableVirtualFileVisitorAttributes.
*
- * @param includeDirectories whether to include directories
- * @param recurseDirectories whether to recurse into directories
+ * @param leavesOnly whether to visit leaves only
+ * @param recurse whether to recurse
*/
- public ImmutableVisitorAttributes(boolean includeDirectories, boolean recurseDirectories)
+ public ImmutableVisitorAttributes(boolean leavesOnly, boolean recurse)
{
- super.setIncludeDirectories(includeDirectories);
- super.setRecurseDirectories(recurseDirectories);
+ super.setLeavesOnly(leavesOnly);
+ super.setRecurse(recurse);
}
@Override
- public void setIncludeDirectories(boolean includeDirectories)
+ public void setLeavesOnly(boolean leavesOnly)
{
throw new IllegalStateException("The preconfigured attributes are immutable");
}
@@ -208,7 +208,7 @@
}
@Override
- public void setRecurseDirectories(boolean recurseDirectories)
+ public void setRecurse(boolean recurse)
{
throw new IllegalStateException("The preconfigured attributes are immutable");
}
@@ -220,7 +220,7 @@
}
@Override
- public void setIgnoreHidden(boolean ignoreHidden)
+ public void setIncludeHidden(boolean includeHidden)
{
throw new IllegalStateException("The preconfigured attributes are immutable");
}
Modified: projects/microcontainer/trunk/container/src/main/org/jboss/virtual/plugins/context/AbstractURIHandler.java
===================================================================
--- projects/microcontainer/trunk/container/src/main/org/jboss/virtual/plugins/context/AbstractURIHandler.java 2006-09-28 03:17:27 UTC (rev 57255)
+++ projects/microcontainer/trunk/container/src/main/org/jboss/virtual/plugins/context/AbstractURIHandler.java 2006-09-28 09:49:20 UTC (rev 57256)
@@ -88,12 +88,6 @@
return false;
}
- public boolean isFile() throws IOException
- {
- checkClosed();
- return isDirectory() == false;
- }
-
public boolean isHidden() throws IOException
{
checkClosed();
Modified: projects/microcontainer/trunk/container/src/main/org/jboss/virtual/plugins/context/AbstractURLHandler.java
===================================================================
--- projects/microcontainer/trunk/container/src/main/org/jboss/virtual/plugins/context/AbstractURLHandler.java 2006-09-28 03:17:27 UTC (rev 57255)
+++ projects/microcontainer/trunk/container/src/main/org/jboss/virtual/plugins/context/AbstractURLHandler.java 2006-09-28 09:49:20 UTC (rev 57256)
@@ -98,12 +98,6 @@
return false;
}
- public boolean isFile() throws IOException
- {
- checkClosed();
- return isDirectory() == false;
- }
-
public boolean isHidden() throws IOException
{
checkClosed();
@@ -120,5 +114,4 @@
{
return url.toURI();
}
-
}
Modified: projects/microcontainer/trunk/container/src/main/org/jboss/virtual/plugins/context/AbstractVFSContext.java
===================================================================
--- projects/microcontainer/trunk/container/src/main/org/jboss/virtual/plugins/context/AbstractVFSContext.java 2006-09-28 03:17:27 UTC (rev 57255)
+++ projects/microcontainer/trunk/container/src/main/org/jboss/virtual/plugins/context/AbstractVFSContext.java 2006-09-28 09:49:20 UTC (rev 57256)
@@ -124,12 +124,12 @@
VisitorAttributes attributes = visitor.getAttributes();
boolean includeRoot = attributes.isIncludeRoot();
- boolean includeDirs = attributes.isIncludeDirectories();
- boolean recurseDirs = attributes.isRecurseDirectories();
+ boolean leavesOnly = attributes.isLeavesOnly();
+ boolean recurse = attributes.isRecurse();
boolean ignoreErrors = attributes.isIgnoreErrors();
- boolean ignoreHidden = attributes.isIgnoreHidden();
+ boolean includeHidden = attributes.isIncludeHidden();
- visit(handler, visitor, includeRoot, includeDirs, recurseDirs, ignoreErrors, ignoreHidden);
+ visit(handler, visitor, includeRoot, leavesOnly, recurse, ignoreErrors, includeHidden);
}
/**
@@ -139,13 +139,13 @@
* @param handler the reference handler
* @param visitor the visitor
* @param includeRoot whether to visit the root
- * @param includeDirs whether to visit directories
- * @param recurseDirs whether to recurse into directories
+ * @param leavesOnly whether to visit leaves only
+ * @param recurse whether to recurse
* @param ignoreErrors whether to ignore errors
- * @param ignoreHidden whether to ignore hidden files
+ * @param includeHidden whether to include hidden files
* @throws IOException for any problem accessing the virtual file system
*/
- protected void visit(VirtualFileHandler handler, VirtualFileHandlerVisitor visitor, boolean includeRoot, boolean includeDirs, boolean recurseDirs, boolean ignoreErrors, boolean ignoreHidden) throws IOException
+ protected void visit(VirtualFileHandler handler, VirtualFileHandlerVisitor visitor, boolean includeRoot, boolean leavesOnly, boolean recurse, boolean ignoreErrors, boolean includeHidden) throws IOException
{
// Visit the root when asked
if (includeRoot)
@@ -169,20 +169,20 @@
for (VirtualFileHandler child : children)
{
// Ignore hidden if asked
- if (ignoreHidden && child.isHidden())
+ if (includeHidden == false && child.isHidden())
continue;
- // Exclude directories if asked
- boolean isDirectory = child.isDirectory();
- if (includeDirs || isDirectory == false)
+ // Visit the leaf or non-leaves when asked
+ boolean isLeaf = child.isLeaf();
+ if (leavesOnly == false || isLeaf)
visitor.visit(child);
- // Recurse into directories when asked
- if (recurseDirs && isDirectory)
+ // Recurse when asked
+ if (recurse && isLeaf == false)
{
try
{
- visit(child, visitor, false, includeDirs, recurseDirs, ignoreErrors, ignoreHidden);
+ visit(child, visitor, false, leavesOnly, recurse, ignoreErrors, includeHidden);
}
catch (StackOverflowError e)
{
Modified: projects/microcontainer/trunk/container/src/main/org/jboss/virtual/plugins/context/AbstractVirtualFileHandler.java
===================================================================
--- projects/microcontainer/trunk/container/src/main/org/jboss/virtual/plugins/context/AbstractVirtualFileHandler.java 2006-09-28 03:17:27 UTC (rev 57255)
+++ projects/microcontainer/trunk/container/src/main/org/jboss/virtual/plugins/context/AbstractVirtualFileHandler.java 2006-09-28 09:49:20 UTC (rev 57256)
@@ -232,12 +232,12 @@
return this;
// Go through each context starting from ours
- // check the parent contexts are directories
+ // check the parents are not leaves.
VirtualFileHandler current = this;
for (int i = 0; i < tokens.length; ++i)
{
- if (current.isDirectory() == false)
- throw new IOException("Not a directory: " + current);
+ if (current.isLeaf())
+ throw new IOException("File cannot have children: " + current);
if (current instanceof StructuredVirtualFileHandler)
{
StructuredVirtualFileHandler structured = (StructuredVirtualFileHandler) current;
Modified: projects/microcontainer/trunk/container/src/main/org/jboss/virtual/plugins/context/DelegatingHandler.java
===================================================================
--- projects/microcontainer/trunk/container/src/main/org/jboss/virtual/plugins/context/DelegatingHandler.java 2006-09-28 03:17:27 UTC (rev 57255)
+++ projects/microcontainer/trunk/container/src/main/org/jboss/virtual/plugins/context/DelegatingHandler.java 2006-09-28 09:49:20 UTC (rev 57256)
@@ -24,8 +24,10 @@
import java.io.IOException;
import java.io.InputStream;
+import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
+import java.net.URL;
import java.util.List;
import org.jboss.virtual.spi.VFSContext;
@@ -41,11 +43,15 @@
*/
public class DelegatingHandler extends AbstractVirtualFileHandler
{
+ /** Serialization */
private static final long serialVersionUID = 1;
+
+ /** The delegate */
private VirtualFileHandler delegate;
/**
* Create a DelegatingHandler
+ *
* @param context - the context for the parent
* @param parent - the parent of the delegate in this VFS
* @param name - the name of the delegate in this VFS
@@ -83,16 +89,11 @@
return delegate.isArchive();
}
- public boolean isDirectory() throws IOException
+ public boolean isLeaf() throws IOException
{
- return delegate.isDirectory();
+ return delegate.isLeaf();
}
- public boolean isFile() throws IOException
- {
- return delegate.isFile();
- }
-
public boolean isHidden() throws IOException
{
return delegate.isHidden();
@@ -108,4 +109,8 @@
return delegate.toURI();
}
+ public URL toURL() throws URISyntaxException, MalformedURLException
+ {
+ return delegate.toURL();
+ }
}
Modified: projects/microcontainer/trunk/container/src/main/org/jboss/virtual/plugins/context/file/FileHandler.java
===================================================================
--- projects/microcontainer/trunk/container/src/main/org/jboss/virtual/plugins/context/file/FileHandler.java 2006-09-28 03:17:27 UTC (rev 57255)
+++ projects/microcontainer/trunk/container/src/main/org/jboss/virtual/plugins/context/file/FileHandler.java 2006-09-28 09:49:20 UTC (rev 57256)
@@ -114,18 +114,15 @@
public boolean isArchive()
{
- if (isDirectory() == false)
+ if (getFile().isDirectory() == false)
return false;
return JarUtils.isArchive(getName());
}
- public boolean isDirectory()
+ public boolean isLeaf()
{
- return getFile().isDirectory();
- }
-
- public boolean isFile()
- {
+ if (isArchive())
+ return false;
return getFile().isFile();
}
Modified: projects/microcontainer/trunk/container/src/main/org/jboss/virtual/plugins/context/file/LinkHandler.java
===================================================================
--- projects/microcontainer/trunk/container/src/main/org/jboss/virtual/plugins/context/file/LinkHandler.java 2006-09-28 03:17:27 UTC (rev 57255)
+++ projects/microcontainer/trunk/container/src/main/org/jboss/virtual/plugins/context/file/LinkHandler.java 2006-09-28 09:49:20 UTC (rev 57256)
@@ -88,9 +88,9 @@
return null;
}
- public boolean isDirectory() throws IOException
+ public boolean isLeaf() throws IOException
{
- return true;
+ return false;
}
}
@@ -178,14 +178,8 @@
return false;
}
- public boolean isDirectory()
+ public boolean isLeaf()
{
- return true;
- }
-
- @Override
- public boolean isFile()
- {
return false;
}
Modified: projects/microcontainer/trunk/container/src/main/org/jboss/virtual/plugins/context/jar/AbstractJarHandler.java
===================================================================
--- projects/microcontainer/trunk/container/src/main/org/jboss/virtual/plugins/context/jar/AbstractJarHandler.java 2006-09-28 03:17:27 UTC (rev 57255)
+++ projects/microcontainer/trunk/container/src/main/org/jboss/virtual/plugins/context/jar/AbstractJarHandler.java 2006-09-28 09:49:20 UTC (rev 57256)
@@ -146,10 +146,10 @@
return true;
}
- public boolean isDirectory()
+ public boolean isLeaf()
{
checkClosed();
- return true;
+ return false;
}
public List<VirtualFileHandler> getChildren(boolean ignoreErrors) throws IOException
Modified: projects/microcontainer/trunk/container/src/main/org/jboss/virtual/plugins/context/jar/JarEntryHandler.java
===================================================================
--- projects/microcontainer/trunk/container/src/main/org/jboss/virtual/plugins/context/jar/JarEntryHandler.java 2006-09-28 03:17:27 UTC (rev 57255)
+++ projects/microcontainer/trunk/container/src/main/org/jboss/virtual/plugins/context/jar/JarEntryHandler.java 2006-09-28 09:49:20 UTC (rev 57256)
@@ -100,16 +100,11 @@
return false;
}
- public boolean isDirectory()
+ public boolean isLeaf()
{
- return getEntry().isDirectory();
+ return getEntry().isDirectory() == false;
}
- public boolean isFile()
- {
- return isDirectory() == false;
- }
-
public boolean isHidden()
{
checkClosed();
Modified: projects/microcontainer/trunk/container/src/main/org/jboss/virtual/plugins/context/jar/NestedJarFromStream.java
===================================================================
--- projects/microcontainer/trunk/container/src/main/org/jboss/virtual/plugins/context/jar/NestedJarFromStream.java 2006-09-28 03:17:27 UTC (rev 57255)
+++ projects/microcontainer/trunk/container/src/main/org/jboss/virtual/plugins/context/jar/NestedJarFromStream.java 2006-09-28 09:49:20 UTC (rev 57256)
@@ -72,7 +72,6 @@
return child;
}
-
public List<VirtualFileHandler> getChildren(boolean ignoreErrors) throws IOException
{
if( inited == false )
@@ -82,19 +81,16 @@
return children;
}
-
- public boolean isFile()
+ public boolean isArchive() throws IOException
{
return true;
}
- public boolean isDirectory()
+
+ public boolean isLeaf() throws IOException
{
return false;
}
- public boolean isArchive()
- {
- return true;
- }
+
public boolean isHidden()
{
return false;
@@ -338,16 +334,13 @@
return entry.getSize();
}
- public boolean isDirectory()
+ public boolean isLeaf()
{
- return isJar;
+ if (isJar)
+ return false;
+ return entry.isDirectory() == false;
}
- public boolean isFile()
- {
- return isJar == false;
- }
-
// Stream accessor
public synchronized InputStream openStream()
throws IOException
Modified: projects/microcontainer/trunk/container/src/main/org/jboss/virtual/plugins/vfs/helpers/SuffixMatchFilter.java
===================================================================
--- projects/microcontainer/trunk/container/src/main/org/jboss/virtual/plugins/vfs/helpers/SuffixMatchFilter.java 2006-09-28 03:17:27 UTC (rev 57255)
+++ projects/microcontainer/trunk/container/src/main/org/jboss/virtual/plugins/vfs/helpers/SuffixMatchFilter.java 2006-09-28 09:49:20 UTC (rev 57256)
@@ -38,7 +38,7 @@
/**
* Create a new SuffixMatchFilter,
- * using {@link VisitorAttributes#RECURSE_NO_DIRECTORIES}
+ * using {@link VisitorAttributes#RECURSE_LEAVES_ONLY}
*
* @param suffix the suffix
* @throws IllegalArgumentException for a null suffix
@@ -52,12 +52,12 @@
* Create a new SuffixMatchFilter.
*
* @param suffix the suffix
- * @param attributes the attributes, pass null to use {@link VisitorAttributes#RECURSE_NO_DIRECTORIES}
+ * @param attributes the attributes, pass null to use {@link VisitorAttributes#RECURSE_LEAVES_ONLY}
* @throws IllegalArgumentException for a null suffix
*/
public SuffixMatchFilter(String suffix, VisitorAttributes attributes)
{
- super(attributes == null ? VisitorAttributes.RECURSE_NO_DIRECTORIES : attributes);
+ super(attributes == null ? VisitorAttributes.RECURSE_LEAVES_ONLY : attributes);
if (suffix == null)
throw new IllegalArgumentException("Null suffix");
this.suffix = suffix;
Modified: projects/microcontainer/trunk/container/src/main/org/jboss/virtual/spi/VirtualFileHandler.java
===================================================================
--- projects/microcontainer/trunk/container/src/main/org/jboss/virtual/spi/VirtualFileHandler.java 2006-09-28 03:17:27 UTC (rev 57255)
+++ projects/microcontainer/trunk/container/src/main/org/jboss/virtual/spi/VirtualFileHandler.java 2006-09-28 09:49:20 UTC (rev 57256)
@@ -91,29 +91,23 @@
long getSize() throws IOException;
/**
- * Whether it is a directory
+ * Whether it is a simple leaf of the VFS,
+ * i.e. whether it can contain other files
*
- * @return true if a directory.
- * @throws IOException for any problem accessing the virtual file system
- * @throws IllegalStateException if closed
- */
- boolean isDirectory() throws IOException;
-
- /**
- * Whether it is a simple file
- *
* @return true if a simple file.
* @throws IOException for any problem accessing the virtual file system
- * @throws IllegalStateException if closed
+ * @throws IllegalStateException if the file is closed
*/
- boolean isFile() throws IOException;
+ boolean isLeaf() throws IOException;
/**
- * Whether it is an archive
+ * Whether it is an archive<p>
+ *
+ * NOTE: a file system directory can be an archive if it looks like an unpacked archive
*
- * @return the archive
+ * @return true when an archive
* @throws IOException for any problem accessing the virtual file system
- * @throws IllegalStateException if closed
+ * @throws IllegalStateException if the file is closed
*/
boolean isArchive() throws IOException;
Modified: projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/support/AbstractMockVirtualFileHandler.java
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/support/AbstractMockVirtualFileHandler.java 2006-09-28 03:17:27 UTC (rev 57255)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/support/AbstractMockVirtualFileHandler.java 2006-09-28 09:49:20 UTC (rev 57256)
@@ -24,8 +24,10 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
+import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
+import java.net.URL;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
@@ -58,8 +60,8 @@
/** Size */
private long size;
- /** Is a directory */
- private boolean directory;
+ /** Is a leaf */
+ private boolean leaf = true;
/** Is an archive */
private boolean archive;
@@ -152,7 +154,7 @@
throw new IllegalArgumentException("Null child");
if (children.contains(child) == false)
children.add(child);
- directory = true;
+ leaf = false;
}
public long getLastModified() throws IOException
@@ -206,30 +208,23 @@
this.archive = archive;
}
- public boolean isDirectory() throws IOException
+ public boolean isLeaf() throws IOException
{
checkClosed();
- throwIOException("isDirectory");
- return directory;
+ throwIOException("isLeaf");
+ return leaf;
}
/**
- * Set directory.
+ * Set leaf.
*
- * @param directory whether it is a directory.
+ * @param leaf whether this is a leaf.
*/
- public void setDirectory(boolean directory)
+ public void setLeaf(boolean leaf)
{
- this.directory = directory;
+ this.leaf = leaf;
}
- public boolean isFile() throws IOException
- {
- checkClosed();
- throwIOException("isFile");
- return directory == false;
- }
-
public boolean isHidden() throws IOException
{
checkClosed();
@@ -270,6 +265,12 @@
}
@Override
+ public URL toURL() throws MalformedURLException, URISyntaxException
+ {
+ return MockVFSContext.createMockURL(uri);
+ }
+
+ @Override
public VirtualFileHandler getParent() throws IOException
{
throwIOException("getParent");
Added: projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/support/MockURLStreamHandler.java
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/support/MockURLStreamHandler.java 2006-09-28 03:17:27 UTC (rev 57255)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/support/MockURLStreamHandler.java 2006-09-28 09:49:20 UTC (rev 57256)
@@ -0,0 +1,51 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.virtual.support;
+
+import java.io.IOException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.net.URLStreamHandler;
+
+/**
+ * MockURLStreamHandler.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class MockURLStreamHandler extends URLStreamHandler
+{
+ /** The singleton */
+ public static final MockURLStreamHandler INSTANCE = new MockURLStreamHandler();
+
+ /**
+ * Singleton
+ */
+ private MockURLStreamHandler()
+ {
+ }
+
+ protected URLConnection openConnection(URL u) throws IOException
+ {
+ throw new org.jboss.util.NotImplementedException("openConnection");
+ }
+}
Modified: projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/support/MockVFSContext.java
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/support/MockVFSContext.java 2006-09-28 03:17:27 UTC (rev 57255)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/support/MockVFSContext.java 2006-09-28 09:49:20 UTC (rev 57256)
@@ -22,8 +22,10 @@
package org.jboss.test.virtual.support;
import java.io.IOException;
+import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
+import java.net.URL;
import org.jboss.util.UnexpectedThrowable;
import org.jboss.virtual.VirtualFile;
@@ -66,6 +68,18 @@
}
/**
+ * Create mock URL
+ *
+ * @param uri the uri
+ * @return the url
+ * @throws MalformedURLException for any error
+ */
+ public static URL createMockURL(URI uri) throws MalformedURLException
+ {
+ return new URL(uri.getScheme(), uri.getHost(), uri.getPort(), uri.getRawPath(), MockURLStreamHandler.INSTANCE);
+ }
+
+ /**
* Create a new MockVFSContext.
*
* @param name the name
@@ -127,4 +141,15 @@
rootFile.close();
super.finalize();
}
+
+ /**
+ * Get the root URL
+ *
+ * @return the url
+ * @throws MalformedURLException for any error
+ */
+ public URL getRootURL() throws MalformedURLException
+ {
+ return createMockURL(getRootURI());
+ }
}
Modified: projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/support/MockVFSContextFactory.java
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/support/MockVFSContextFactory.java 2006-09-28 03:17:27 UTC (rev 57255)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/support/MockVFSContextFactory.java 2006-09-28 09:49:20 UTC (rev 57256)
@@ -23,11 +23,11 @@
import java.io.IOException;
import java.net.URI;
+import java.net.URISyntaxException;
import java.net.URL;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
-import org.jboss.util.NotImplementedException;
import org.jboss.virtual.spi.VFSContext;
import org.jboss.virtual.spi.VFSContextFactory;
@@ -83,6 +83,19 @@
throw new IOException("No such context " + rootURI);
return context;
}
+
+ public VFSContext getVFS(URL rootURL) throws IOException
+ {
+ throwIOException("getVFSURL");
+ try
+ {
+ return getVFS(rootURL.toURI());
+ }
+ catch (URISyntaxException e)
+ {
+ throw new IOException("Error creating URI: " + rootURL);
+ }
+ }
/**
* Add a context
@@ -118,9 +131,4 @@
contexts.clear();
ioException = "";
}
-
- public VFSContext getVFS(URL rootURL) throws IOException
- {
- throw new NotImplementedException("URLs are not implemented for the mock virtual file system");
- }
}
Modified: projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/test/FileVFSUnitTestCase.java
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/test/FileVFSUnitTestCase.java 2006-09-28 03:17:27 UTC (rev 57255)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/test/FileVFSUnitTestCase.java 2006-09-28 09:49:20 UTC (rev 57256)
@@ -189,7 +189,7 @@
VirtualFile root = vfs.findChild("");
assertEquals("root name", "test", root.getName());
assertEquals("root path", "", root.getPathName());
- assertTrue("root isDirectory", root.isDirectory());
+ assertFalse("root isDirectory", root.isLeaf());
// Find the outer.jar
VirtualFile outerJar = vfs.findChild("outer.jar");
@@ -206,7 +206,7 @@
root = vfs.findChild("");
assertEquals("root name", "test", root.getName());
assertEquals("root path", "", root.getPathName());
- assertTrue("root isDirectory", root.isDirectory());
+ assertFalse("root isDirectory", root.isLeaf());
}
/**
@@ -251,7 +251,7 @@
VirtualFile root = vfs.findChild("");
assertEquals("root name", "test", root.getName());
assertEquals("root path", "", root.getPathName());
- assertTrue("root isDirectory", root.isDirectory());
+ assertFalse("root isDirectory", root.isLeaf());
// Find the outer.jar
VirtualFile outerJar = vfs.findChild("unpacked-outer.jar");
@@ -268,7 +268,7 @@
root = vfs.findChild("");
assertEquals("root name", "test", root.getName());
assertEquals("root path", "", root.getPathName());
- assertTrue("root isDirectory", root.isDirectory());
+ assertFalse("root isDirectory", root.isLeaf());
}
/**
@@ -281,7 +281,7 @@
URL rootURL = getResource("/vfs/test");
VFS vfs = VFS.getVFS(rootURL);
VirtualFile inner = vfs.findChild("outer.jar/jar1.jar");
- log.info("IsFile: "+inner.isFile());
+ log.info("IsFile: "+inner.isLeaf());
log.info(inner.getLastModified());
List<VirtualFile> contents = inner.getChildren();
// META-INF/*, org/jboss/test/vfs/support/jar1/* at least
@@ -371,8 +371,7 @@
assertEquals("size", size, tmpVF.getSize());
assertEquals("url", url, tmpVF.toURL());
assertEquals("isArchive", false, tmpVF.isArchive());
- assertEquals("isFile", true, tmpVF.isFile());
- assertEquals("isDirectory", false, tmpVF.isDirectory());
+ assertEquals("isLeaf", true, tmpVF.isLeaf());
assertEquals("isHidden", false, tmpVF.isHidden());
// Read in the VF from the serialized file
@@ -387,8 +386,7 @@
assertEquals("size", size, tmpVF2.getSize());
assertEquals("url", url, tmpVF2.toURL());
assertEquals("isArchive", false, tmpVF2.isArchive());
- assertEquals("isFile", true, tmpVF2.isFile());
- assertEquals("isDirectory", false, tmpVF2.isDirectory());
+ assertEquals("isLeaf", true, tmpVF2.isLeaf());
assertEquals("isHidden", false, tmpVF2.isHidden());
}
@@ -586,7 +584,7 @@
VirtualFile classes = war.findChild("WEB-INF/classes");
String classesName = classes.getName();
String classesPathName = classes.getPathName();
- boolean classesIsDirectory = classes.isDirectory();
+ boolean classesIsDirectory = classes.isLeaf() == false;
assertEquals("classes.name", "classes", classesName);
assertEquals("classes.pathName", "test-link.war/WEB-INF/classes", classesPathName);
assertEquals("classes.isDirectory", true, classesIsDirectory);
@@ -598,7 +596,7 @@
VirtualFile lib = war.findChild("WEB-INF/lib");
String libName = lib.getName();
String libPathName = lib.getPathName();
- boolean libIsDirectory = lib.isDirectory();
+ boolean libIsDirectory = lib.isLeaf() == false;
assertEquals("lib.name", "lib", libName);
assertEquals("lib.pathName", "test-link.war/WEB-INF/lib", libPathName);
assertEquals("lib.isDirectory", true, libIsDirectory);
Modified: projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/test/VFSUnitTestCase.java
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/test/VFSUnitTestCase.java 2006-09-28 03:17:27 UTC (rev 57255)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/test/VFSUnitTestCase.java 2006-09-28 09:49:20 UTC (rev 57256)
@@ -30,6 +30,7 @@
import junit.framework.Test;
import junit.framework.TestSuite;
+import org.jboss.test.virtual.support.MockURLStreamHandler;
import org.jboss.test.virtual.support.MockVFSContext;
import org.jboss.test.virtual.support.MockVirtualFileFilter;
import org.jboss.virtual.VFS;
@@ -111,21 +112,19 @@
}
}
- /* TODO URL testing
public void testGetVFSURL() throws Exception
{
MockVFSContext context = registerSimpleVFSContext();
MockVFSContext context2 = registerSimple2VFSContext();
- VFS vfs = VFS.getVFS(context.getRootURI().toURL());
+ VFS vfs = VFS.getVFS(context.getRootURL());
assertNotNull(vfs);
assertEquals(context.getVFS(), vfs);
- VFS vfs2 = VFS.getVFS(context2.getRootURI().toURL());
+ VFS vfs2 = VFS.getVFS(context2.getRootURL());
assertNotNull(vfs2);
assertEquals(context2.getVFS(), vfs2);
}
- */
public void testGetVFSURLNull() throws Exception
{
@@ -140,12 +139,11 @@
}
}
- /* TODO URL Testing
public void testGetVFSURLNoFactory() throws Exception
{
try
{
- URL url = new URL("doesnotexist:///");
+ URL url = new URL("doesnotexist", "", 0, "", MockURLStreamHandler.INSTANCE);
VFS.getVFS(url);
fail("Should not be here");
}
@@ -162,7 +160,7 @@
try
{
- VFS.getVFS(context.getRootURI().toURL());
+ VFS.getVFS(context.getRootURL());
fail("Should not be here");
}
catch (Throwable t)
@@ -170,7 +168,6 @@
checkThrowable(IOException.class, t);
}
}
- */
public void testGetRootURI() throws Exception
{
@@ -358,16 +355,14 @@
}
}
- /* TODO URL testing
public void testGetRootURL() throws Exception
{
MockVFSContext context = registerSimpleVFSContextWithChildren();
- VirtualFile file = VFS.getRoot(context.getRootURI().toURL());
+ VirtualFile file = VFS.getRoot(context.getRootURL());
assertNotNull(file);
assertEquals(context.getRoot().getVirtualFile(), file);
}
- */
public void testGetRootURLNullURL() throws Exception
{
@@ -382,10 +377,9 @@
}
}
- /* TODO URL testing
public void testGetRootURLNoFactory() throws Exception
{
- URL url = new URL("doesnotexist:///");
+ URL url = new URL("doesnotexist", "", 0, "", MockURLStreamHandler.INSTANCE);
try
{
VFS.getRoot(url);
@@ -402,7 +396,7 @@
MockVFSContext context = registerSimpleVFSContextWithChildren();
mockVFSContextFactory.setIOException("getVFSURL");
- URL url = context.getRootURI().toURL();
+ URL url = context.getRootURL();
try
{
VFS.getRoot(url);
@@ -419,7 +413,7 @@
MockVFSContext context = registerSimpleVFSContextWithChildren();
context.setIOException("getRoot");
- URL url = context.getRootURI().toURL();
+ URL url = context.getRootURL();
try
{
VFS.getRoot(url);
@@ -435,7 +429,7 @@
{
MockVFSContext context = registerSimpleVFSContextWithChildren();
- VirtualFile file = VFS.getVirtualFile(context.getRootURI().toURL(), "");
+ VirtualFile file = VFS.getVirtualFile(context.getRootURL(), "");
assertNotNull(file);
assertEquals(context.getRoot().getVirtualFile(), file);
}
@@ -447,19 +441,18 @@
VirtualFile child2 = getChildHandler(context, "child2").getVirtualFile();
VirtualFile child3 = getChildHandler(context, "child3").getVirtualFile();
- VirtualFile file1 = VFS.getVirtualFile(context.getRootURI().toURL(), "child1");
+ VirtualFile file1 = VFS.getVirtualFile(context.getRootURL(), "child1");
assertNotNull(file1);
assertEquals(child1, file1);
- VirtualFile file2 = VFS.getVirtualFile(context.getRootURI().toURL(), "child2");
+ VirtualFile file2 = VFS.getVirtualFile(context.getRootURL(), "child2");
assertNotNull(file2);
assertEquals(child2, file2);
- VirtualFile file3 = VFS.getVirtualFile(context.getRootURI().toURL(), "child3");
+ VirtualFile file3 = VFS.getVirtualFile(context.getRootURL(), "child3");
assertNotNull(file3);
assertEquals(child3, file3);
}
- */
public void testGetVirtualFileURLNullURL() throws Exception
{
@@ -474,14 +467,13 @@
}
}
- /* TODO URL testing
public void testGetVirtualFileURLNullPath() throws Exception
{
MockVFSContext context = registerSimpleVFSContextWithChildren();
try
{
- VFS.getVirtualFile(context.getRootURI().toURL(), null);
+ VFS.getVirtualFile(context.getRootURL(), null);
fail("Should not be here");
}
catch (Throwable t)
@@ -494,8 +486,8 @@
{
try
{
- URL uri = new URL("doesnotexist:///");
- VFS.getVirtualFile(uri, "");
+ URL url = new URL("doesnotexist", "", 0, "", MockURLStreamHandler.INSTANCE);
+ VFS.getVirtualFile(url, "");
fail("Should not be here");
}
catch (Throwable t)
@@ -511,7 +503,7 @@
try
{
- VFS.getVirtualFile(context.getRootURI().toURL(), "child1");
+ VFS.getVirtualFile(context.getRootURL(), "child1");
fail("Should not be here");
}
catch (Throwable t)
@@ -550,7 +542,6 @@
checkThrowable(IOException.class, t);
}
}
- */
public void testGetRoot() throws Exception
{
@@ -587,7 +578,7 @@
public void testFindChildRoot() throws Exception
{
MockVFSContext context = registerSimpleVFSContext();
- context.getMockRoot().setDirectory(true);
+ context.getMockRoot().setLeaf(false);
VFS vfs = VFS.getVFS(context.getRootURI());
@@ -738,7 +729,7 @@
public void testGetAllChildrenNoChildren() throws Exception
{
MockVFSContext context = registerSimpleVFSContext();
- context.getMockRoot().setDirectory(true);
+ context.getMockRoot().setLeaf(false);
VFS vfs = VFS.getVFS(context.getRootURI());
List<VirtualFile> children = vfs.getChildren();
@@ -747,7 +738,7 @@
assertEmpty(children);
}
- public void testGetAllChildrenNotADirectory() throws Exception
+ public void testGetAllChildrenIsLeaf() throws Exception
{
MockVFSContext context = registerSimpleVFSContext();
@@ -821,7 +812,7 @@
public void testGetAllChildrenWithNullFilterNoChildren() throws Exception
{
MockVFSContext context = registerSimpleVFSContext();
- context.getMockRoot().setDirectory(true);
+ context.getMockRoot().setLeaf(false);
VFS vfs = VFS.getVFS(context.getRootURI());
List<VirtualFile> children = vfs.getChildren(null);
@@ -830,7 +821,7 @@
assertEmpty(children);
}
- public void testGetAllChildrenWithNullFilterNotADirectory() throws Exception
+ public void testGetAllChildrenWithNullFilterIsLeaf() throws Exception
{
MockVFSContext context = registerSimpleVFSContext();
@@ -908,7 +899,7 @@
public void testGetAllChildrenWithFilterNoChildren() throws Exception
{
MockVFSContext context = registerSimpleVFSContext();
- context.getMockRoot().setDirectory(true);
+ context.getMockRoot().setLeaf(false);
VFS vfs = VFS.getVFS(context.getRootURI());
MockVirtualFileFilter filter = new MockVirtualFileFilter();
@@ -919,7 +910,7 @@
assertEmpty(filter.getVisited());
}
- public void testGetAllChildrenWithFilterNotADirectory() throws Exception
+ public void testGetAllChildrenWithFilterIsLeaf() throws Exception
{
MockVFSContext context = registerSimpleVFSContext();
@@ -1007,7 +998,7 @@
public void testGetAllChildrenRecursivelyNoChildren() throws Exception
{
MockVFSContext context = registerSimpleVFSContext();
- context.getMockRoot().setDirectory(true);
+ context.getMockRoot().setLeaf(false);
VFS vfs = VFS.getVFS(context.getRootURI());
List<VirtualFile> children = vfs.getChildrenRecursively();
@@ -1016,7 +1007,7 @@
assertEmpty(children);
}
- public void testGetAllChildrenRecursivelyNotADirectory() throws Exception
+ public void testGetAllChildrenRecursivelyIsLeaf() throws Exception
{
MockVFSContext context = registerSimpleVFSContext();
@@ -1102,7 +1093,7 @@
public void testGetAllChildrenRecursivelyWithNullFilterNoChildren() throws Exception
{
MockVFSContext context = registerSimpleVFSContext();
- context.getMockRoot().setDirectory(true);
+ context.getMockRoot().setLeaf(false);
VFS vfs = VFS.getVFS(context.getRootURI());
List<VirtualFile> children = vfs.getChildrenRecursively(null);
@@ -1111,7 +1102,7 @@
assertEmpty(children);
}
- public void testGetAllChildrenRecursivelyWithNullFilterNotADirectory() throws Exception
+ public void testGetAllChildrenRecursivelyWithNullFilterIsLeaf() throws Exception
{
MockVFSContext context = registerSimpleVFSContext();
@@ -1201,7 +1192,7 @@
public void testGetAllChildrenRecursivelyWithFilterNoChildren() throws Exception
{
MockVFSContext context = registerSimpleVFSContext();
- context.getMockRoot().setDirectory(true);
+ context.getMockRoot().setLeaf(false);
VFS vfs = VFS.getVFS(context.getRootURI());
MockVirtualFileFilter filter = new MockVirtualFileFilter();
@@ -1212,7 +1203,7 @@
assertEmpty(filter.getVisited());
}
- public void testGetAllChildrenRecursivelyWithFilterNotADirectory() throws Exception
+ public void testGetAllChildrenRecursivelyWithFilterIsLeaf() throws Exception
{
MockVFSContext context = registerSimpleVFSContext();
@@ -1290,7 +1281,7 @@
public void testVisitAllChildrenNoChildren() throws Exception
{
MockVFSContext context = registerSimpleVFSContext();
- context.getMockRoot().setDirectory(true);
+ context.getMockRoot().setLeaf(false);
VFS vfs = VFS.getVFS(context.getRootURI());
MockVirtualFileFilter filter = new MockVirtualFileFilter();
@@ -1300,7 +1291,7 @@
assertEmpty(filter.getVisited());
}
- public void testVisitAllChildrenNotADirectory() throws Exception
+ public void testVisitAllChildrenIsLeaf() throws Exception
{
MockVFSContext context = registerSimpleVFSContext();
Modified: projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/test/VirtualFileUnitTestCase.java
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/test/VirtualFileUnitTestCase.java 2006-09-28 03:17:27 UTC (rev 57255)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/test/VirtualFileUnitTestCase.java 2006-09-28 09:49:20 UTC (rev 57256)
@@ -24,6 +24,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
+import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -140,11 +141,10 @@
assertEquals(child11.toURI(), found11.toURI());
}
- /* TODO URL testing
public void testToURL() throws Exception
{
MockVFSContext context = registerStructuredVFSContextWithSubChildren();
- URL url = context.getRootURI().toURL();
+ URL url = context.getRootURL();
VirtualFile child1 = getChildHandler(context, "child1").getVirtualFile();
VirtualFile child11 = getChildHandler(context, "child1/child1,1").getVirtualFile();
@@ -157,7 +157,6 @@
VirtualFile found11 = root.findChild("child1/child1,1");
assertEquals(child11.toURL(), found11.toURL());
}
- */
public void testGetLastModfied() throws Exception
{
@@ -251,27 +250,27 @@
}
}
- public void testIsDirectory() throws Exception
+ public void testIsLeaf() throws Exception
{
MockVFSContext context = registerSimpleVFSContext();
- context.getMockRoot().setDirectory(true);
+ context.getMockRoot().setLeaf(false);
VirtualFile file = VFS.getRoot(context.getRootURI());
- assertEquals(true, file.isDirectory());
+ assertEquals(false, file.isLeaf());
- context.getMockRoot().setDirectory(false);
- assertEquals(false, file.isDirectory());
+ context.getMockRoot().setLeaf(true);
+ assertEquals(true, file.isLeaf());
}
- public void testIsDirectoryIOException() throws Exception
+ public void testIsLeafIOException() throws Exception
{
MockVFSContext context = registerSimpleVFSContext();
- context.getMockRoot().setIOException("isDirectory");
+ context.getMockRoot().setIOException("isLeaf");
VirtualFile file = VFS.getRoot(context.getRootURI());
try
{
- file.isDirectory();
+ file.isLeaf();
fail("Should not be here");
}
catch (Throwable t)
@@ -280,7 +279,7 @@
}
}
- public void testIsDirectoryClosed() throws Exception
+ public void testIsLeafClosed() throws Exception
{
MockVFSContext context = registerSimpleVFSContext();
@@ -288,7 +287,7 @@
file.close();
try
{
- file.isDirectory();
+ file.isLeaf();
fail("Should not be here");
}
catch (Throwable t)
@@ -296,52 +295,6 @@
checkThrowable(IllegalStateException.class, t);
}
}
-
- public void testIsFile() throws Exception
- {
- MockVFSContext context = registerSimpleVFSContext();
- context.getMockRoot().setDirectory(true);
-
- VirtualFile file = VFS.getRoot(context.getRootURI());
- assertEquals(false, file.isFile());
-
- context.getMockRoot().setDirectory(false);
- assertEquals(true, file.isFile());
- }
-
- public void testIsFileIOException() throws Exception
- {
- MockVFSContext context = registerSimpleVFSContext();
- context.getMockRoot().setIOException("isFile");
-
- VirtualFile file = VFS.getRoot(context.getRootURI());
- try
- {
- file.isFile();
- fail("Should not be here");
- }
- catch (Throwable t)
- {
- checkThrowable(IOException.class, t);
- }
- }
-
- public void testIsFileClosed() throws Exception
- {
- MockVFSContext context = registerSimpleVFSContext();
-
- VirtualFile file = VFS.getRoot(context.getRootURI());
- file.close();
- try
- {
- file.isFile();
- fail("Should not be here");
- }
- catch (Throwable t)
- {
- checkThrowable(IllegalStateException.class, t);
- }
- }
public void testIsArchive() throws Exception
{
@@ -660,7 +613,7 @@
public void testGetAllChildrenNoChildren() throws Exception
{
MockVFSContext context = registerSimpleVFSContext();
- context.getMockRoot().setDirectory(true);
+ context.getMockRoot().setLeaf(false);
VirtualFile file = VFS.getRoot(context.getRootURI());
List<VirtualFile> children = file.getChildren();
@@ -669,7 +622,7 @@
assertEmpty(children);
}
- public void testGetAllChildrenNotADirectory() throws Exception
+ public void testGetAllChildrenIsLeaf() throws Exception
{
MockVFSContext context = registerSimpleVFSContext();
@@ -743,7 +696,7 @@
public void testGetAllChildrenWithNullFilterNoChildren() throws Exception
{
MockVFSContext context = registerSimpleVFSContext();
- context.getMockRoot().setDirectory(true);
+ context.getMockRoot().setLeaf(false);
VirtualFile file = VFS.getRoot(context.getRootURI());
List<VirtualFile> children = file.getChildren(null);
@@ -752,7 +705,7 @@
assertEmpty(children);
}
- public void testGetAllChildrenWithNullFilterNotADirectory() throws Exception
+ public void testGetAllChildrenWithNullFilterIsLeaf() throws Exception
{
MockVFSContext context = registerSimpleVFSContext();
@@ -830,7 +783,7 @@
public void testGetAllChildrenWithFilterNoChildren() throws Exception
{
MockVFSContext context = registerSimpleVFSContext();
- context.getMockRoot().setDirectory(true);
+ context.getMockRoot().setLeaf(false);
VirtualFile file = VFS.getRoot(context.getRootURI());
MockVirtualFileFilter filter = new MockVirtualFileFilter();
@@ -841,7 +794,7 @@
assertEmpty(filter.getVisited());
}
- public void testGetAllChildrenWithFilterNotADirectory() throws Exception
+ public void testGetAllChildrenWithFilterIsLeaf() throws Exception
{
MockVFSContext context = registerSimpleVFSContext();
@@ -929,7 +882,7 @@
public void testGetAllChildrenRecursivelyNoChildren() throws Exception
{
MockVFSContext context = registerSimpleVFSContext();
- context.getMockRoot().setDirectory(true);
+ context.getMockRoot().setLeaf(false);
VirtualFile file = VFS.getRoot(context.getRootURI());
List<VirtualFile> children = file.getChildrenRecursively();
@@ -938,7 +891,7 @@
assertEmpty(children);
}
- public void testGetAllChildrenRecursivelyNotADirectory() throws Exception
+ public void testGetAllChildrenRecursivelyIsLeaf() throws Exception
{
MockVFSContext context = registerSimpleVFSContext();
@@ -1024,7 +977,7 @@
public void testGetAllChildrenRecursivelyWithNullFilterNoChildren() throws Exception
{
MockVFSContext context = registerSimpleVFSContext();
- context.getMockRoot().setDirectory(true);
+ context.getMockRoot().setLeaf(false);
VirtualFile file = VFS.getRoot(context.getRootURI());
List<VirtualFile> children = file.getChildrenRecursively(null);
@@ -1033,7 +986,7 @@
assertEmpty(children);
}
- public void testGetAllChildrenRecursivelyWithNullFilterNotADirectory() throws Exception
+ public void testGetAllChildrenRecursivelyWithNullFilterIsLeaf() throws Exception
{
MockVFSContext context = registerSimpleVFSContext();
@@ -1123,7 +1076,7 @@
public void testGetAllChildrenRecursivelyWithFilterNoChildren() throws Exception
{
MockVFSContext context = registerSimpleVFSContext();
- context.getMockRoot().setDirectory(true);
+ context.getMockRoot().setLeaf(false);
VirtualFile file = VFS.getRoot(context.getRootURI());
MockVirtualFileFilter filter = new MockVirtualFileFilter();
@@ -1134,7 +1087,7 @@
assertEmpty(filter.getVisited());
}
- public void testGetAllChildrenRecursivelyWithFilterNotADirectory() throws Exception
+ public void testGetAllChildrenRecursivelyWithFilterIsLeaf() throws Exception
{
MockVFSContext context = registerSimpleVFSContext();
@@ -1213,7 +1166,7 @@
public void testVisitAllChildrenNoChildren() throws Exception
{
MockVFSContext context = registerSimpleVFSContext();
- context.getMockRoot().setDirectory(true);
+ context.getMockRoot().setLeaf(false);
VirtualFile file = VFS.getRoot(context.getRootURI());
MockVirtualFileFilter filter = new MockVirtualFileFilter();
@@ -1223,7 +1176,7 @@
assertEmpty(filter.getVisited());
}
- public void testVisitAllChildrenNotADirectory() throws Exception
+ public void testVisitAllChildrenIsLeaf() throws Exception
{
MockVFSContext context = registerSimpleVFSContext();
@@ -1279,7 +1232,7 @@
public void testFindChildSame() throws Exception
{
MockVFSContext context = registerSimpleVFSContext();
- context.getMockRoot().setDirectory(true);
+ context.getMockRoot().setLeaf(false);
VirtualFile root = VFS.getRoot(context.getRootURI());
Modified: projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/deployment/MainDeployerImpl.java
===================================================================
--- projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/deployment/MainDeployerImpl.java 2006-09-28 03:17:27 UTC (rev 57255)
+++ projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/deployment/MainDeployerImpl.java 2006-09-28 09:49:20 UTC (rev 57256)
@@ -53,6 +53,7 @@
import org.jboss.deployers.spi.structure.DeploymentContext;
import org.jboss.deployers.spi.structure.vfs.StructureDeployer;
import org.jboss.logging.Logger;
+import org.jboss.virtual.VirtualFile;
/**
* MainDeployerImpl.
@@ -395,7 +396,11 @@
{
String name = context.getName();
// TODO Need some metadata that says we expect a deployment to only provide classes
- if (context.isDeployed() == false && context.getRoot().getName().endsWith(".jar") == false)
+ boolean isJar = false;
+ VirtualFile root = context.getRoot();
+ if (root != null && root.getName().endsWith(".jar"))
+ isJar = true;
+ if (context.isDeployed() == false && isJar == false)
missingDeployers.put(name, context);
context.setState(DEPLOYED);
log.debug("Deployed: " + name);
Modified: projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/structure/AbstractDeploymentContext.java
===================================================================
--- projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/structure/AbstractDeploymentContext.java 2006-09-28 03:17:27 UTC (rev 57255)
+++ projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/structure/AbstractDeploymentContext.java 2006-09-28 09:49:20 UTC (rev 57256)
@@ -575,7 +575,7 @@
if (metaDataLocation == null)
{
// It has to be a plain file that is not an archive
- if (root != null && root.isFile() && root.isArchive() == false)
+ if (root != null && root.isLeaf() && root.isArchive() == false)
{
String fileName = root.getName();
if (fileName.equals(name))
@@ -609,7 +609,7 @@
if (metaDataLocation == null)
{
// It has to be a plain file that is not an archive
- if (root != null && root.isFile() && root.isArchive() == false)
+ if (root != null && root.isLeaf() && root.isArchive() == false)
{
String fileName = root.getName();
if (name != null && fileName.equals(name))
Modified: projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/structure/MetaDataMatchFilter.java
===================================================================
--- projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/structure/MetaDataMatchFilter.java 2006-09-28 03:17:27 UTC (rev 57255)
+++ projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/structure/MetaDataMatchFilter.java 2006-09-28 09:49:20 UTC (rev 57256)
@@ -44,7 +44,7 @@
/**
* Create a new MetaDataMatchFilter.
- * using {@link VisitorAttributes#NO_DIRECTORIES}
+ * using {@link VisitorAttributes#LEAVES_ONLY}
*
* @param name the name to exactly match
* @param suffix the suffix to partially match
@@ -60,7 +60,7 @@
*
* @param name the name to exactly match
* @param suffix the suffix to partially match
- * @param attributes the attributes, pass null to use {@link VisitorAttributes#NO_DIRECTORIES}
+ * @param attributes the attributes, pass null to use {@link VisitorAttributes#LEAVES_ONLY}
* @throws IllegalArgumentException if both the name and suffix are null
*/
public MetaDataMatchFilter(String name, String suffix, VisitorAttributes attributes)
@@ -70,7 +70,7 @@
this.name = name;
this.suffix = suffix;
if (attributes == null)
- attributes = VisitorAttributes.NO_DIRECTORIES;
+ attributes = VisitorAttributes.LEAVES_ONLY;
this.attributes = attributes;
}
Modified: projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/structure/vfs/CandidateStructureVisitor.java
===================================================================
--- projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/structure/vfs/CandidateStructureVisitor.java 2006-09-28 03:17:27 UTC (rev 57255)
+++ projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/structure/vfs/CandidateStructureVisitor.java 2006-09-28 09:49:20 UTC (rev 57256)
@@ -104,7 +104,7 @@
try
{
- if (ignoreDirectories && virtualFile.isDirectory() && virtualFile.isArchive() == false)
+ if (ignoreDirectories && virtualFile.isLeaf() && virtualFile.isArchive() == false)
return null;
}
catch (IOException e)
Modified: projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/structure/vfs/file/FileStructure.java
===================================================================
--- projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/structure/vfs/file/FileStructure.java 2006-09-28 03:17:27 UTC (rev 57255)
+++ projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/structure/vfs/file/FileStructure.java 2006-09-28 09:49:20 UTC (rev 57256)
@@ -99,7 +99,7 @@
try
{
VirtualFile root = context.getRoot();
- if (root.isFile())
+ if (root.isLeaf())
{
// It must be top level
if (context.isTopLevel() == false)
Modified: projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/structure/vfs/jar/JARStructure.java
===================================================================
--- projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/structure/vfs/jar/JARStructure.java 2006-09-28 03:17:27 UTC (rev 57255)
+++ projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/structure/vfs/jar/JARStructure.java 2006-09-28 09:49:20 UTC (rev 57256)
@@ -49,7 +49,7 @@
try
{
VirtualFile root = context.getRoot();
- if (root.isDirectory())
+ if (root.isLeaf() == false)
{
if (root.isArchive() == false)
{
Modified: projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/structure/vfs/war/WARStructure.java
===================================================================
--- projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/structure/vfs/war/WARStructure.java 2006-09-28 03:17:27 UTC (rev 57255)
+++ projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/structure/vfs/war/WARStructure.java 2006-09-28 09:49:20 UTC (rev 57256)
@@ -49,7 +49,7 @@
try
{
VirtualFile root = context.getRoot();
- if (root.isDirectory())
+ if (root.isLeaf() == false)
{
// We require either a WEB-INF or the name ends in .war
if (root.getName().endsWith(".war") == false)
Modified: projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/structure/vfs/war/WebInfLibFilter.java
===================================================================
--- projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/structure/vfs/war/WebInfLibFilter.java 2006-09-28 03:17:27 UTC (rev 57255)
+++ projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/structure/vfs/war/WebInfLibFilter.java 2006-09-28 09:49:20 UTC (rev 57256)
@@ -27,7 +27,6 @@
import org.jboss.virtual.VirtualFile;
import org.jboss.virtual.VirtualFileFilterWithAttributes;
import org.jboss.virtual.VisitorAttributes;
-import org.jboss.virtual.plugins.context.jar.JarUtils;
/**
* Filters web-inf/lib for archives
@@ -63,10 +62,6 @@
// We want archives
if (file.isArchive())
return true;
-
- // Or directories pretending to be archives
- if (file.isDirectory() && JarUtils.isArchive(file.getName()))
- return true;
}
catch (IOException e)
{
More information about the jboss-cvs-commits
mailing list