{
// remove "file:" from path, so we can use in File constructor
jarPath = jarPath.substring(5);
}
File jarFile = new File(jarPath);
mf = new JarFile(jarFile).getManifest();
if (mf == null)
{
return null;
}
return registerBundle(mf, jarFile.toURI().toURL());
}
}
else if (manifest.getProtocol().equals("rar") || manifest.getProtocol().equals("war"))
{
// protocol formats:
// rar:<rar-path>!<jar-path>!<manifest-file>, war:<war-path>!<jar-path>!<manifest-file>
String path = StringUtils.getDecodedStringFromURLString(manifest.toExternalForm());
int index = path.indexOf(JAR_SEPARATOR);
String rarPath = path.substring(4, index);
File file = new File(rarPath);
URL rarUrl = file.toURI().toURL();
String jarPath = path.substring(index+1, path.indexOf(JAR_SEPARATOR,index+1));
JarFile rarFile = new JarFile(file);
mf = new JarInputStream(rarFile.getInputStream(rarFile.getEntry(jarPath))).getManifest();
if (mf == null)
{
return null;
}
return registerBundle(mf, rarUrl);