This commit is contained in:
sponge
2012-03-15 00:39:11 +00:00
parent 1aa6367517
commit 1f407bc34f
3 changed files with 28 additions and 23 deletions

View File

@@ -201,10 +201,7 @@ public class PluginStarter implements Runnable {
File pluginUpdate = new File(ctx.getConfigDir(), PluginUpdateHandler.PLUGIN_DIR + '/' + appName + "/app.xpi2p.zip" );
if(pluginUpdate.exists()) {
// Compare the start time of the router with the plugin.
List<RouterContext> contexts = RouterContext.listContexts();
if ( (contexts == null) || (contexts.isEmpty()) )
throw new IllegalStateException("No contexts. This is usually because the router is either starting up or shutting down.");
if(contexts.get(0).router().getWhenStarted() > pluginUpdate.lastModified()) {
if(ctx.router().getWhenStarted() > pluginUpdate.lastModified()) {
if (!FileUtil.extractZip(pluginUpdate, pluginDir)) {
pluginUpdate.delete();
String foo = "Plugin '" + appName + "' failed to update! File '" + pluginUpdate +"' deleted. You may need to remove and install the plugin again.";