try {
String pluginId = "java." + pluginName.toLowerCase() + "." + pluginName;
PluginProxy installedPlugin = PluginProxyManager.getInstance().getPluginForId(pluginId);
TvDataServiceProxy service = TvDataServiceProxyManager.getInstance().findDataServiceById(
pluginName.toLowerCase() + '.' + pluginName);
Class<?> pluginClass = classLoader.loadClass(pluginName.toLowerCase() + '.' + pluginName);
Method getVersion = pluginClass.getMethod("getVersion", new Class[0]);
Version version1 = null;
try {
version1 = (Version) getVersion.invoke(pluginClass, new Object[0]);
} catch (Throwable t1) {
t1.printStackTrace();
}
if (installedPlugin != null && (installedPlugin.getInfo().getVersion().compareTo(version1) > 0 || (installedPlugin.getInfo().getVersion().compareTo(version1) == 0 && version1.isStable()))) {
alreadyInstalled.append(installedPlugin.getInfo().getName()).append('\n');
} else if (service != null && (service.getInfo().getVersion().compareTo(version1) > 0 || (service.getInfo().getVersion().compareTo(version1) == 0 && version1.isStable()))) {
alreadyInstalled.append(service.getInfo().getName()).append('\n');
} else {
RandomAccessFile write = new RandomAccessFile(tmpFile, "rw");
String versionString = Integer.toString(version1.getMajor()) + '.' + (version1.getMinor() / 10) + (version1.getMinor() % 10)
+ '.' + version1.getSubMinor();