URL pluginUrl = new URL(pluginBaseURLStr + "/"
+ pluginJarFileName);
String className = pluginJarFileName.replace(".jar", "");
IPlugin plugin = createObjectFromJarURL(pluginUrl,
className);
remoteDescriptions.put(plugin.getDescription(),
pluginJarFileName);
remotePlugins.put(pluginJarFileName, pluginUrl);
// Store dependent libs, if any exist, by plugin key.
if (fields.length == 2) {
if (interrupted)
break;
File pluginLibDirPath = new File(
System.getProperty("user.home")
+ File.separator + PLUGIN_LIBS_DIR);
for (String libFileStr : fields[1].split("\\s*,\\s*")) {
String libJarFileName = libFileStr;
URL libUrl = new URL(libBaseURLStr + "/"
+ libJarFileName);
List<URL> libUrls = libs.get(pluginJarFileName);
if (libUrls == null) {
libUrls = new ArrayList<URL>();
libs.put(pluginJarFileName, libUrls);
}
libUrls.add(libUrl);
// Populate dependent library name and reference
// counting maps. Note that we treat the remote
// plugin information as the source of truth for the
// basis of checking against local library jar
// files. Our reference counting will only be as
// good as this remote/local correspondence.
File localLibJarFilePath = new File(
pluginLibDirPath, libJarFileName);
if (localLibJarFilePath.exists()) {
if (!libDescriptions.containsKey(plugin
.getDescription())) {
libDescriptions.put(
plugin.getDescription(),
new HashSet<String>());
}
libDescriptions.get(plugin.getDescription())
.add(libJarFileName);
if (!libRefs.containsKey(libJarFileName)) {
libRefs.put(libJarFileName, 1);
} else {