// Remove files
FileUtil.deleteFile(installRoot);
}
protected ClassLoader createClassLoader() {
SharedLibraryDesc library = descriptor.getSharedLibrary();
// Make the current ClassLoader the parent
ClassLoader parent = BundleDelegatingClassLoader.createBundleClassLoaderFor(bundle, getClass().getClassLoader());
boolean parentFirst = library.isParentFirstClassLoaderDelegation();
ClassPath cp = library.getSharedLibraryClassPath();
String[] classPathNames = cp.getPathElements();
List<URL> urls = new ArrayList<URL>();
for (String classPathName : classPathNames) {
File f = new File(installRoot, classPathName);
if (!f.exists()) {
LOGGER.warn("Shared library classpath entry not found: '" + classPathName + "'");
}
try {
urls.add(f.getCanonicalFile().toURL());
} catch (IOException e) {
throw new IllegalArgumentException("Shared library classpath entry not found: '" + classPathName + "'");
}
}
return new MultiParentClassLoader(
library.getIdentification().getName(),
urls.toArray(new URL[urls.size()]),
parent,
!parentFirst,
new String[0],
new String[]{"java.", "javax."});