The Bundle-ClassPath is now handles in OSGiClassLoaderFactory like this
https://jira.jboss.org/jira/browse/JBOSGI-162
public ClassLoaderPolicy createClassLoaderPolicy()
{
VFSDeploymentUnit vfsUnit = (VFSDeploymentUnit)unit;
OSGiBundleState bundleState = unit.getAttachment(OSGiBundleState.class);
VirtualFile[] roots = getClassLoaderPolicyRoots(bundleState, vfsUnit);
return new OSGiClassLoaderPolicy(bundleState, roots);
}
private VirtualFile[] getClassLoaderPolicyRoots(OSGiBundleState bundleState, VFSDeploymentUnit vfsUnit)
{
VirtualFile root = vfsUnit.getRoot();
// If there is no Bundle-ClassPath in the manifest, simply use the root
List<String> bundleClassPath = bundleState.getOSGiMetaData().getBundleClassPath();
if (bundleClassPath == null)
{
return new VirtualFile[] { root };
}
log.debug("Bundle-ClassPath: " + bundleClassPath);
// Add a vfs root for every Bundle-ClassPath element
List<VirtualFile> rootsList = new ArrayList<VirtualFile>();
for (String path : bundleClassPath)
{
if (path.equals("."))
{
rootsList.add(root);
}
else
{
try
{
VirtualFile child = root.getChild(path);
rootsList.add(child);
}
catch (IOException ex)
{
throw new IllegalArgumentException("Cannot find class path '" + path + "' in: " + root);
}
}
}
VirtualFile[] rootsArray = new VirtualFile[rootsList.size()];
rootsList.toArray(rootsArray);
return rootsArray;
}