forked from I2P_Developers/i2p.i2p
* Plugins: Remove final check and install console
messages after a while
This commit is contained in:
@ -4,6 +4,7 @@ import java.io.ByteArrayInputStream;
|
|||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
|
||||||
import net.i2p.I2PAppContext;
|
import net.i2p.I2PAppContext;
|
||||||
@ -14,6 +15,8 @@ import net.i2p.util.EepGet;
|
|||||||
import net.i2p.util.I2PAppThread;
|
import net.i2p.util.I2PAppThread;
|
||||||
import net.i2p.util.Log;
|
import net.i2p.util.Log;
|
||||||
import net.i2p.util.PartialEepGet;
|
import net.i2p.util.PartialEepGet;
|
||||||
|
import net.i2p.util.SimpleScheduler;
|
||||||
|
import net.i2p.util.SimpleTimer;
|
||||||
import net.i2p.util.VersionComparator;
|
import net.i2p.util.VersionComparator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -46,6 +49,20 @@ public class PluginUpdateChecker extends UpdateHandler {
|
|||||||
super(ctx);
|
super(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** check all plugins */
|
||||||
|
public void update() {
|
||||||
|
Thread t = new I2PAppThread(new AllCheckerRunner(), "AllAppChecker", true);
|
||||||
|
t.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
public class AllCheckerRunner implements Runnable {
|
||||||
|
public void run() {
|
||||||
|
List<String> plugins = PluginStarter.getPlugins();
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** check a single plugin */
|
||||||
public void update(String appName) {
|
public void update(String appName) {
|
||||||
// don't block waiting for the other one to finish
|
// don't block waiting for the other one to finish
|
||||||
if ("true".equals(System.getProperty(PROP_UPDATE_IN_PROGRESS))) {
|
if ("true".equals(System.getProperty(PROP_UPDATE_IN_PROGRESS))) {
|
||||||
@ -84,6 +101,21 @@ public class PluginUpdateChecker extends UpdateHandler {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void scheduleStatusClean(String msg) {
|
||||||
|
SimpleScheduler.getInstance().addEvent(new Cleaner(msg), 60*60*1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
private class Cleaner implements SimpleTimer.TimedEvent {
|
||||||
|
private String _msg;
|
||||||
|
public Cleaner(String msg) {
|
||||||
|
_msg = msg;
|
||||||
|
}
|
||||||
|
public void timeReached() {
|
||||||
|
if (_msg.equals(getStatus()))
|
||||||
|
updateStatus("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public class PluginUpdateCheckerRunner extends UpdateRunner implements Runnable, EepGet.StatusListener {
|
public class PluginUpdateCheckerRunner extends UpdateRunner implements Runnable, EepGet.StatusListener {
|
||||||
ByteArrayOutputStream _baos;
|
ByteArrayOutputStream _baos;
|
||||||
|
|
||||||
@ -116,17 +148,22 @@ public class PluginUpdateChecker extends UpdateHandler {
|
|||||||
public void transferComplete(long alreadyTransferred, long bytesTransferred, long bytesRemaining, String url, String outputFile, boolean notModified) {
|
public void transferComplete(long alreadyTransferred, long bytesTransferred, long bytesRemaining, String url, String outputFile, boolean notModified) {
|
||||||
String newVersion = TrustedUpdate.getVersionString(new ByteArrayInputStream(_baos.toByteArray()));
|
String newVersion = TrustedUpdate.getVersionString(new ByteArrayInputStream(_baos.toByteArray()));
|
||||||
boolean newer = (new VersionComparator()).compare(newVersion, _oldVersion) > 0;
|
boolean newer = (new VersionComparator()).compare(newVersion, _oldVersion) > 0;
|
||||||
|
String msg;
|
||||||
if (newer)
|
if (newer)
|
||||||
updateStatus("<b>" + _("New plugin version {0} is available", newVersion) + "</b>");
|
msg = "<b>" + _("New plugin version {0} is available", newVersion) + "</b>";
|
||||||
else
|
else
|
||||||
updateStatus("<b>" + _("No new version is available for plugin {0}", _appName) + "</b>");
|
msg = "<b>" + _("No new version is available for plugin {0}", _appName) + "</b>";
|
||||||
|
updateStatus(msg);
|
||||||
|
scheduleStatusClean(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void transferFailed(String url, long bytesTransferred, long bytesRemaining, int currentAttempt) {
|
public void transferFailed(String url, long bytesTransferred, long bytesRemaining, int currentAttempt) {
|
||||||
File f = new File(_updateFile);
|
File f = new File(_updateFile);
|
||||||
f.delete();
|
f.delete();
|
||||||
updateStatus("<b>" + _("Update check failed for plugin {0}", _appName) + "</b>");
|
String msg = "<b>" + _("Update check failed for plugin {0}", _appName) + "</b>";
|
||||||
|
updateStatus(msg);
|
||||||
|
scheduleStatusClean(msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,8 @@ import net.i2p.util.FileUtil;
|
|||||||
import net.i2p.util.I2PAppThread;
|
import net.i2p.util.I2PAppThread;
|
||||||
import net.i2p.util.Log;
|
import net.i2p.util.Log;
|
||||||
import net.i2p.util.OrderedProperties;
|
import net.i2p.util.OrderedProperties;
|
||||||
|
import net.i2p.util.SimpleScheduler;
|
||||||
|
import net.i2p.util.SimpleTimer;
|
||||||
import net.i2p.util.VersionComparator;
|
import net.i2p.util.VersionComparator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -89,6 +91,21 @@ public class PluginUpdateHandler extends UpdateHandler {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void scheduleStatusClean(String msg) {
|
||||||
|
SimpleScheduler.getInstance().addEvent(new Cleaner(msg), 60*60*1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
private class Cleaner implements SimpleTimer.TimedEvent {
|
||||||
|
private String _msg;
|
||||||
|
public Cleaner(String msg) {
|
||||||
|
_msg = msg;
|
||||||
|
}
|
||||||
|
public void timeReached() {
|
||||||
|
if (_msg.equals(getStatus()))
|
||||||
|
updateStatus("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public class PluginUpdateRunner extends UpdateRunner implements Runnable, EepGet.StatusListener {
|
public class PluginUpdateRunner extends UpdateRunner implements Runnable, EepGet.StatusListener {
|
||||||
|
|
||||||
public PluginUpdateRunner(String url) {
|
public PluginUpdateRunner(String url) {
|
||||||
@ -136,7 +153,7 @@ public class PluginUpdateHandler extends UpdateHandler {
|
|||||||
File appDir = new File(_context.getAppDir(), PLUGIN_DIR);
|
File appDir = new File(_context.getAppDir(), PLUGIN_DIR);
|
||||||
if ((!appDir.exists()) && (!appDir.mkdir())) {
|
if ((!appDir.exists()) && (!appDir.mkdir())) {
|
||||||
f.delete();
|
f.delete();
|
||||||
updateStatus("<b>" + _("Cannot create plugin directory {0}", appDir.getAbsolutePath()) + "</b>");
|
statusDone("<b>" + _("Cannot create plugin directory {0}", appDir.getAbsolutePath()) + "</b>");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -145,7 +162,7 @@ public class PluginUpdateHandler extends UpdateHandler {
|
|||||||
// extract to a zip file whether the sig is good or not, so we can get the properties file
|
// extract to a zip file whether the sig is good or not, so we can get the properties file
|
||||||
String err = up.migrateFile(f, to);
|
String err = up.migrateFile(f, to);
|
||||||
if (err != null) {
|
if (err != null) {
|
||||||
updateStatus("<b>" + err + ' ' + _("from {0}", url) + " </b>");
|
statusDone("<b>" + err + ' ' + _("from {0}", url) + " </b>");
|
||||||
f.delete();
|
f.delete();
|
||||||
to.delete();
|
to.delete();
|
||||||
return;
|
return;
|
||||||
@ -155,7 +172,7 @@ public class PluginUpdateHandler extends UpdateHandler {
|
|||||||
f.delete();
|
f.delete();
|
||||||
to.delete();
|
to.delete();
|
||||||
FileUtil.rmdir(tempDir, false);
|
FileUtil.rmdir(tempDir, false);
|
||||||
updateStatus("<b>" + _("Plugin from {0} is corrupt", url) + "</b>");
|
statusDone("<b>" + _("Plugin from {0} is corrupt", url) + "</b>");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
File installProps = new File(tempDir, "plugin.config");
|
File installProps = new File(tempDir, "plugin.config");
|
||||||
@ -166,7 +183,7 @@ public class PluginUpdateHandler extends UpdateHandler {
|
|||||||
f.delete();
|
f.delete();
|
||||||
to.delete();
|
to.delete();
|
||||||
FileUtil.rmdir(tempDir, false);
|
FileUtil.rmdir(tempDir, false);
|
||||||
updateStatus("<b>" + _("Plugin from {0} does not contain the required configuration file", url) + "</b>");
|
statusDone("<b>" + _("Plugin from {0} does not contain the required configuration file", url) + "</b>");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// we don't need this anymore, we will unzip again
|
// we don't need this anymore, we will unzip again
|
||||||
@ -179,7 +196,7 @@ public class PluginUpdateHandler extends UpdateHandler {
|
|||||||
f.delete();
|
f.delete();
|
||||||
to.delete();
|
to.delete();
|
||||||
//updateStatus("<b>" + "Plugin contains an invalid key" + ' ' + pubkey + ' ' + signer + "</b>");
|
//updateStatus("<b>" + "Plugin contains an invalid key" + ' ' + pubkey + ' ' + signer + "</b>");
|
||||||
updateStatus("<b>" + _("Plugin from {0} contains an invalid key", url) + "</b>");
|
statusDone("<b>" + _("Plugin from {0} contains an invalid key", url) + "</b>");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -198,7 +215,7 @@ public class PluginUpdateHandler extends UpdateHandler {
|
|||||||
if (!signer.equals(signingKeyName)) {
|
if (!signer.equals(signingKeyName)) {
|
||||||
f.delete();
|
f.delete();
|
||||||
to.delete();
|
to.delete();
|
||||||
updateStatus("<b>" + _("Plugin signature verification of {0} failed", url) + "</b>");
|
statusDone("<b>" + _("Plugin signature verification of {0} failed", url) + "</b>");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -207,7 +224,7 @@ public class PluginUpdateHandler extends UpdateHandler {
|
|||||||
// bad or duplicate key
|
// bad or duplicate key
|
||||||
f.delete();
|
f.delete();
|
||||||
to.delete();
|
to.delete();
|
||||||
updateStatus("<b>" + _("Plugin signature verification of {0} failed", url) + "</b>");
|
statusDone("<b>" + _("Plugin signature verification of {0} failed", url) + "</b>");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// ...and try the verify again
|
// ...and try the verify again
|
||||||
@ -216,7 +233,7 @@ public class PluginUpdateHandler extends UpdateHandler {
|
|||||||
if (!signer.equals(signingKeyName)) {
|
if (!signer.equals(signingKeyName)) {
|
||||||
f.delete();
|
f.delete();
|
||||||
to.delete();
|
to.delete();
|
||||||
updateStatus("<b>" + _("Plugin signature verification of {0} failed", url) + "</b>");
|
statusDone("<b>" + _("Plugin signature verification of {0} failed", url) + "</b>");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -231,12 +248,12 @@ public class PluginUpdateHandler extends UpdateHandler {
|
|||||||
version.indexOf("<") >= 0 || version.indexOf(">") >= 0 ||
|
version.indexOf("<") >= 0 || version.indexOf(">") >= 0 ||
|
||||||
appName.startsWith(".") || appName.indexOf("/") >= 0 || appName.indexOf("\\") >= 0) {
|
appName.startsWith(".") || appName.indexOf("/") >= 0 || appName.indexOf("\\") >= 0) {
|
||||||
to.delete();
|
to.delete();
|
||||||
updateStatus("<b>" + _("Plugin from {0} has invalid name or version", url) + "</b>");
|
statusDone("<b>" + _("Plugin from {0} has invalid name or version", url) + "</b>");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!version.equals(sudVersion)) {
|
if (!version.equals(sudVersion)) {
|
||||||
to.delete();
|
to.delete();
|
||||||
updateStatus("<b>" + _("Plugin {0} has mismatched versions", appName) + "</b>");
|
statusDone("<b>" + _("Plugin {0} has mismatched versions", appName) + "</b>");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -244,7 +261,7 @@ public class PluginUpdateHandler extends UpdateHandler {
|
|||||||
if (minVersion != null &&
|
if (minVersion != null &&
|
||||||
(new VersionComparator()).compare(CoreVersion.VERSION, minVersion) < 0) {
|
(new VersionComparator()).compare(CoreVersion.VERSION, minVersion) < 0) {
|
||||||
to.delete();
|
to.delete();
|
||||||
updateStatus("<b>" + _("This plugin requires I2P version {0} or higher", minVersion) + "</b>");
|
statusDone("<b>" + _("This plugin requires I2P version {0} or higher", minVersion) + "</b>");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -252,7 +269,7 @@ public class PluginUpdateHandler extends UpdateHandler {
|
|||||||
if (minVersion != null &&
|
if (minVersion != null &&
|
||||||
(new VersionComparator()).compare(System.getProperty("java.version"), minVersion) < 0) {
|
(new VersionComparator()).compare(System.getProperty("java.version"), minVersion) < 0) {
|
||||||
to.delete();
|
to.delete();
|
||||||
updateStatus("<b>" + _("This plugin requires Java version {0} or higher", minVersion) + "</b>");
|
statusDone("<b>" + _("This plugin requires Java version {0} or higher", minVersion) + "</b>");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -260,7 +277,7 @@ public class PluginUpdateHandler extends UpdateHandler {
|
|||||||
if (destDir.exists()) {
|
if (destDir.exists()) {
|
||||||
if (Boolean.valueOf(props.getProperty("install-only")).booleanValue()) {
|
if (Boolean.valueOf(props.getProperty("install-only")).booleanValue()) {
|
||||||
to.delete();
|
to.delete();
|
||||||
updateStatus("<b>" + _("Downloaded plugin is for new installs only, but the plugin is already installed", url) + "</b>");
|
statusDone("<b>" + _("Downloaded plugin is for new installs only, but the plugin is already installed", url) + "</b>");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -272,7 +289,7 @@ public class PluginUpdateHandler extends UpdateHandler {
|
|||||||
} catch (IOException ioe) {
|
} catch (IOException ioe) {
|
||||||
to.delete();
|
to.delete();
|
||||||
FileUtil.rmdir(tempDir, false);
|
FileUtil.rmdir(tempDir, false);
|
||||||
updateStatus("<b>" + _("Installed plugin does not contain the required configuration file", url) + "</b>");
|
statusDone("<b>" + _("Installed plugin does not contain the required configuration file", url) + "</b>");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String oldPubkey = oldProps.getProperty("key");
|
String oldPubkey = oldProps.getProperty("key");
|
||||||
@ -280,28 +297,28 @@ public class PluginUpdateHandler extends UpdateHandler {
|
|||||||
String oldAppName = props.getProperty("name");
|
String oldAppName = props.getProperty("name");
|
||||||
if ((!pubkey.equals(oldPubkey)) || (!signer.equals(oldKeyName)) || (!appName.equals(oldAppName))) {
|
if ((!pubkey.equals(oldPubkey)) || (!signer.equals(oldKeyName)) || (!appName.equals(oldAppName))) {
|
||||||
to.delete();
|
to.delete();
|
||||||
updateStatus("<b>" + _("Signature of downloaded plugin does not match installed plugin") + "</b>");
|
statusDone("<b>" + _("Signature of downloaded plugin does not match installed plugin") + "</b>");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String oldVersion = oldProps.getProperty("version");
|
String oldVersion = oldProps.getProperty("version");
|
||||||
if (oldVersion == null ||
|
if (oldVersion == null ||
|
||||||
(new VersionComparator()).compare(oldVersion, version) >= 0) {
|
(new VersionComparator()).compare(oldVersion, version) >= 0) {
|
||||||
to.delete();
|
to.delete();
|
||||||
updateStatus("<b>" + _("Downloaded plugin version {0} is not newer than installed plugin", version) + "</b>");
|
statusDone("<b>" + _("Downloaded plugin version {0} is not newer than installed plugin", version) + "</b>");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
minVersion = ConfigClientsHelper.stripHTML(props, "min-installed-version");
|
minVersion = ConfigClientsHelper.stripHTML(props, "min-installed-version");
|
||||||
if (minVersion != null &&
|
if (minVersion != null &&
|
||||||
(new VersionComparator()).compare(minVersion, oldVersion) > 0) {
|
(new VersionComparator()).compare(minVersion, oldVersion) > 0) {
|
||||||
to.delete();
|
to.delete();
|
||||||
updateStatus("<b>" + _("Plugin update requires installed plugin version {0} or higher", minVersion) + "</b>");
|
statusDone("<b>" + _("Plugin update requires installed plugin version {0} or higher", minVersion) + "</b>");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String maxVersion = ConfigClientsHelper.stripHTML(props, "max-installed-version");
|
String maxVersion = ConfigClientsHelper.stripHTML(props, "max-installed-version");
|
||||||
if (maxVersion != null &&
|
if (maxVersion != null &&
|
||||||
(new VersionComparator()).compare(maxVersion, oldVersion) < 0) {
|
(new VersionComparator()).compare(maxVersion, oldVersion) < 0) {
|
||||||
to.delete();
|
to.delete();
|
||||||
updateStatus("<b>" + _("Plugin update requires installed plugin version {0} or lower", maxVersion) + "</b>");
|
statusDone("<b>" + _("Plugin update requires installed plugin version {0} or lower", maxVersion) + "</b>");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -318,12 +335,12 @@ public class PluginUpdateHandler extends UpdateHandler {
|
|||||||
} else {
|
} else {
|
||||||
if (Boolean.valueOf(props.getProperty("update-only")).booleanValue()) {
|
if (Boolean.valueOf(props.getProperty("update-only")).booleanValue()) {
|
||||||
to.delete();
|
to.delete();
|
||||||
updateStatus("<b>" + _("Plugin is for upgrades only, but the plugin is not installed") + "</b>");
|
statusDone("<b>" + _("Plugin is for upgrades only, but the plugin is not installed") + "</b>");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!destDir.mkdir()) {
|
if (!destDir.mkdir()) {
|
||||||
to.delete();
|
to.delete();
|
||||||
updateStatus("<b>" + _("Cannot create plugin directory {0}", destDir.getAbsolutePath()) + "</b>");
|
statusDone("<b>" + _("Cannot create plugin directory {0}", destDir.getAbsolutePath()) + "</b>");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -331,16 +348,16 @@ public class PluginUpdateHandler extends UpdateHandler {
|
|||||||
// Finally, extract the zip to the plugin directory
|
// Finally, extract the zip to the plugin directory
|
||||||
if (!FileUtil.extractZip(to, destDir)) {
|
if (!FileUtil.extractZip(to, destDir)) {
|
||||||
to.delete();
|
to.delete();
|
||||||
updateStatus("<b>" + _("Failed to install plugin in {0}", destDir.getAbsolutePath()) + "</b>");
|
statusDone("<b>" + _("Failed to install plugin in {0}", destDir.getAbsolutePath()) + "</b>");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
to.delete();
|
to.delete();
|
||||||
if (Boolean.valueOf(props.getProperty("dont-start-at-install")).booleanValue()) {
|
if (Boolean.valueOf(props.getProperty("dont-start-at-install")).booleanValue()) {
|
||||||
if (Boolean.valueOf(props.getProperty("router-restart-required")).booleanValue())
|
if (Boolean.valueOf(props.getProperty("router-restart-required")).booleanValue())
|
||||||
updateStatus("<b>" + _("Plugin {0} installed, router restart required", appName) + "</b>");
|
statusDone("<b>" + _("Plugin {0} installed, router restart required", appName) + "</b>");
|
||||||
else {
|
else {
|
||||||
updateStatus("<b>" + _("Plugin {0} installed", appName) + "</b>");
|
statusDone("<b>" + _("Plugin {0} installed", appName) + "</b>");
|
||||||
Properties pluginProps = PluginStarter.pluginProperties();
|
Properties pluginProps = PluginStarter.pluginProperties();
|
||||||
pluginProps.setProperty(PluginStarter.PREFIX + appName + PluginStarter.ENABLED, "false");
|
pluginProps.setProperty(PluginStarter.PREFIX + appName + PluginStarter.ENABLED, "false");
|
||||||
PluginStarter.storePluginProperties(pluginProps);
|
PluginStarter.storePluginProperties(pluginProps);
|
||||||
@ -349,11 +366,11 @@ public class PluginUpdateHandler extends UpdateHandler {
|
|||||||
// start everything
|
// start everything
|
||||||
try {
|
try {
|
||||||
if (PluginStarter.startPlugin(_context, appName))
|
if (PluginStarter.startPlugin(_context, appName))
|
||||||
updateStatus("<b>" + _("Plugin {0} installed and started", appName) + "</b>");
|
statusDone("<b>" + _("Plugin {0} installed and started", appName) + "</b>");
|
||||||
else
|
else
|
||||||
updateStatus("<b>" + _("Plugin {0} installed but failed to start, check logs", appName) + "</b>");
|
statusDone("<b>" + _("Plugin {0} installed but failed to start, check logs", appName) + "</b>");
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
updateStatus("<b>" + _("Plugin {0} installed but failed to start", appName) + ": " + e + "</b>");
|
statusDone("<b>" + _("Plugin {0} installed but failed to start", appName) + ": " + e + "</b>");
|
||||||
_log.error("Error starting plugin " + appName, e);
|
_log.error("Error starting plugin " + appName, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -363,8 +380,14 @@ public class PluginUpdateHandler extends UpdateHandler {
|
|||||||
public void transferFailed(String url, long bytesTransferred, long bytesRemaining, int currentAttempt) {
|
public void transferFailed(String url, long bytesTransferred, long bytesRemaining, int currentAttempt) {
|
||||||
File f = new File(_updateFile);
|
File f = new File(_updateFile);
|
||||||
f.delete();
|
f.delete();
|
||||||
updateStatus("<b>" + _("Failed to download plugin from {0}", url) + "</b>");
|
statusDone("<b>" + _("Failed to download plugin from {0}", url) + "</b>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void statusDone(String msg) {
|
||||||
|
updateStatus(msg);
|
||||||
|
scheduleStatusClean(msg);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Reference in New Issue
Block a user