[jboss-cvs] JBossAS SVN: r96231 - projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/vfs.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Nov 10 15:15:52 EST 2009
Author: alesj
Date: 2009-11-10 15:15:52 -0500 (Tue, 10 Nov 2009)
New Revision: 96231
Modified:
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/vfs/BundleHandler.java
Log:
Fix relative path.
Modified: projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/vfs/BundleHandler.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/vfs/BundleHandler.java 2009-11-10 19:32:57 UTC (rev 96230)
+++ projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/vfs/BundleHandler.java 2009-11-10 20:15:52 UTC (rev 96231)
@@ -52,6 +52,14 @@
this.bundleState = bundleState;
}
+ protected String getRelativePath(boolean checkEnd)
+ {
+ String path = handler.getLocalPathName();
+ if (checkEnd && path.endsWith("/") == false)
+ path += "/";
+ return path;
+ }
+
public URI toURI() throws URISyntaxException
{
return new URI("bundle", Long.toString(bundleState.getBundleId()), handler.getLocalPathName(), null);
@@ -64,14 +72,14 @@
public InputStream openStream() throws IOException
{
- bundleState.getResource(""); // permission check
+ bundleState.getResource(getRelativePath(false)); // permission check
return handler.openStream();
}
public List<VirtualFileHandler> getChildren(boolean ignoreErrors) throws IOException
{
- bundleState.findEntries("", null, false); // permission check
+ bundleState.findEntries(getRelativePath(false), null, false); // permission check
List<VirtualFileHandler> children = handler.getChildren(ignoreErrors);
if (children != null && children.isEmpty() == false)
@@ -88,7 +96,8 @@
public VirtualFileHandler getChild(String path) throws IOException
{
- URL entry = bundleState.getEntry(path); // permission check
+ String fullPath = getRelativePath(true) + path;
+ URL entry = bundleState.getEntry(fullPath); // permission check
if (entry == null)
return null;
More information about the jboss-cvs-commits
mailing list