From a616a5f1c94d1e06b8498089d8beb65d35711c60 Mon Sep 17 00:00:00 2001
From: zzz
Date: Thu, 1 Jan 2009 13:13:04 +0000
Subject: [PATCH] prep for upcoming torrent updater
---
.../src/net/i2p/router/web/UpdateHandler.java | 21 ++++++++-----------
1 file changed, 9 insertions(+), 12 deletions(-)
diff --git a/apps/routerconsole/java/src/net/i2p/router/web/UpdateHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/UpdateHandler.java
index 56c291c43..be39da2fd 100644
--- a/apps/routerconsole/java/src/net/i2p/router/web/UpdateHandler.java
+++ b/apps/routerconsole/java/src/net/i2p/router/web/UpdateHandler.java
@@ -27,13 +27,13 @@ import net.i2p.util.Log;
*
*/
public class UpdateHandler {
- private static UpdateRunner _updateRunner;
- private RouterContext _context;
- private Log _log;
- private DecimalFormat _pct = new DecimalFormat("00.0%");
+ protected static UpdateRunner _updateRunner;
+ protected RouterContext _context;
+ protected Log _log;
+ protected DecimalFormat _pct = new DecimalFormat("00.0%");
- private static final String SIGNED_UPDATE_FILE = "i2pupdate.sud";
- private static final String PROP_UPDATE_IN_PROGRESS = "net.i2p.router.web.UpdateHandler.updateInProgress";
+ protected static final String SIGNED_UPDATE_FILE = "i2pupdate.sud";
+ protected static final String PROP_UPDATE_IN_PROGRESS = "net.i2p.router.web.UpdateHandler.updateInProgress";
public UpdateHandler() {
this(ContextHelper.getContext(null));
@@ -93,9 +93,8 @@ public class UpdateHandler {
}
public class UpdateRunner implements Runnable, EepGet.StatusListener {
- private boolean _isRunning;
- private String _status;
- private long _startedOn;
+ protected boolean _isRunning;
+ protected String _status;
public UpdateRunner() {
_isRunning = false;
_status = "Updating";
@@ -108,8 +107,7 @@ public class UpdateHandler {
System.setProperty(PROP_UPDATE_IN_PROGRESS, "false");
_isRunning = false;
}
- private void update() {
- _startedOn = -1;
+ protected void update() {
_status = "Updating";
String updateURL = selectUpdateURL();
if (_log.shouldLog(Log.DEBUG))
@@ -130,7 +128,6 @@ public class UpdateHandler {
else
get = new EepGet(_context, 1, SIGNED_UPDATE_FILE, updateURL, false);
get.addStatusListener(UpdateRunner.this);
- _startedOn = _context.clock().now();
get.fetch();
} catch (Throwable t) {
_context.logManager().getLog(UpdateHandler.class).error("Error updating", t);