"scott.stark(a)jboss.org" wrote : Right, the test is wrong if JarContext(entry) is
no longer simply returning the JarEntry name, and it should not be.
|
The VFS "name" should never be the empty string.
This is used in many places, e.g. VFSDeployment.getSimpleName()
and will break things if it is empty.
The idea of the "name" is say what artifact you are referring to without the
path.
If you want to add a "contextName" which is just the relevant section used
to construct the pathName then that is fine, but don't change the "name".
Suppose you have
url://some/path/outer.jar/lib/inner.jar
and construct a vfs context from (context name obviously doesn't exist)
root = VFS.getRoot("url://some/path");
root.getName() : "path" (this should not be empty)
root.getPathName() : ""
root.getContextName() : "" (this would be empty because it is the root of the
vfs)
outer = root.getChild("outer.jar");
outer.getName() : "outer.jar");
outer.getPathName() : "outer.jar"
outer.getContextName() : "outer.jar")
inner = get.findChild("lib/inner.jar");
inner.getName() : "inner.jar"
inner.getPathName() : "outer.jar/lib/inner.jar"
inner.getContextName() : "inner.jar"
As you can see the ContextName is the same as the Name
except when it is the root of the VFS (i.e. no parent), so I'm not sure the
ContextName
is really necessary. Or if it is, it could easily be written in the abstract
public String getContextName()
{
if (getParent() == null)
return "";
return getName();
}
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4137723#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...