Author: nextgens
Date: 2006-07-30 19:31:03 +0000 (Sun, 30 Jul 2006)
New Revision: 9829

Modified:
   trunk/freenet/src/freenet/node/updater/NodeUpdater.java
   trunk/freenet/src/freenet/node/updater/UpdateRevocationURICallback.java
   trunk/freenet/src/freenet/node/updater/UpdateURICallback.java
Log:
more work on NodeUpdater

Modified: trunk/freenet/src/freenet/node/updater/NodeUpdater.java
===================================================================
--- trunk/freenet/src/freenet/node/updater/NodeUpdater.java     2006-07-30 
19:23:10 UTC (rev 9828)
+++ trunk/freenet/src/freenet/node/updater/NodeUpdater.java     2006-07-30 
19:31:03 UTC (rev 9829)
@@ -528,29 +528,29 @@

         boolean enabled = updaterConfig.getBoolean("enabled");

+        // is the auto-update allowed ?
+        updaterConfig.register("autoupdate", false, 2, false, "Automatically 
install new versions", "Should your node automatically update to the newest 
version of Freenet, without asking?",
+                       new AutoUpdateAllowedCallback(node));
+        boolean autoUpdateAllowed = updaterConfig.getBoolean("autoupdate");
+
+        updaterConfig.register("URI", NodeUpdater.UPDATE_URI, 3,
+                       true, "Where should the node look for updates?",
+                       "Where should the node look for updates?",
+                       new UpdateURICallback(node));
+
+        String URI = updaterConfig.getString("URI");
+
+
+        updaterConfig.register("revocationURI",        
NodeUpdater.REVOCATION_URI,
+                       3, true, "Where should the node look for revocation ?",
+                       "Where should the node look for revocation ?",
+                       new UpdateRevocationURICallback(node));
+
+        String revURI = updaterConfig.getString("revocationURI");
+
+        updaterConfig.finishedInitialization();
+        
         if(enabled) {
-               // is the auto-update allowed ?
-               updaterConfig.register("autoupdate", false, 2, false, 
"Automatically install new versions", "Should your node automatically update to 
the newest version of Freenet, without asking?",
-                               new AutoUpdateAllowedCallback(node));
-               boolean autoUpdateAllowed = 
updaterConfig.getBoolean("autoupdate");
-               
-               updaterConfig.register("URI", NodeUpdater.UPDATE_URI, 3,
-                               true, "Where should the node look for updates?",
-                               "Where should the node look for updates?",
-                               new UpdateURICallback(node));
-               
-               String URI = updaterConfig.getString("URI");
-               
-               
-               updaterConfig.register("revocationURI", 
NodeUpdater.REVOCATION_URI,
-                               3, true, "Where should the node look for 
revocation ?",
-                               "Where should the node look for revocation ?",
-                               new UpdateRevocationURICallback(node));
-               
-               String revURI = updaterConfig.getString("revocationURI");
-               
-               
-               updaterConfig.finishedInitialization();
                try{
                        return new NodeUpdater(node , autoUpdateAllowed, new 
FreenetURI(URI), new FreenetURI(revURI));
                }catch(Exception e){
@@ -558,7 +558,6 @@
                        throw new Exception("Unable to start the NodeUpdater 
up");
                }
         } else {
-               updaterConfig.finishedInitialization();
                return null;
         }
        }

Modified: 
trunk/freenet/src/freenet/node/updater/UpdateRevocationURICallback.java
===================================================================
--- trunk/freenet/src/freenet/node/updater/UpdateRevocationURICallback.java     
2006-07-30 19:23:10 UTC (rev 9828)
+++ trunk/freenet/src/freenet/node/updater/UpdateRevocationURICallback.java     
2006-07-30 19:31:03 UTC (rev 9829)
@@ -5,10 +5,8 @@
 import freenet.support.Logger;

 public class UpdateRevocationURICallback implements StringCallback{
-
        private final Node node;
-       private static final String baseURI = "SSK at 
VOfCZVTYPaatJ~eB~4lu2cPrWEmGyt4bfbB1v15Z6qQ,B6EynLhm7QE0se~rMgWWhl7wh3rFWjxJsEUcyohAm8A,AQABAAE/revoked/";
-                       
+               
        public UpdateRevocationURICallback(Node node) {
                this.node = node;
        }
@@ -18,7 +16,7 @@
                if (nu != null)
                        return nu.getRevocationKey().toString(true);
                else
-                       return baseURI;
+                       return NodeUpdater.REVOCATION_URI;
        }

        public void set(String val) {

Modified: trunk/freenet/src/freenet/node/updater/UpdateURICallback.java
===================================================================
--- trunk/freenet/src/freenet/node/updater/UpdateURICallback.java       
2006-07-30 19:23:10 UTC (rev 9828)
+++ trunk/freenet/src/freenet/node/updater/UpdateURICallback.java       
2006-07-30 19:31:03 UTC (rev 9829)
@@ -2,13 +2,10 @@

 import freenet.config.StringCallback;
 import freenet.node.Node;
-import freenet.node.Version;
 import freenet.support.Logger;

 public class UpdateURICallback implements StringCallback{
-
        private final Node node;
-       private static final String baseURI = "freenet:USK at 
SIDKS6l-eOU8IQqDo03d~3qqBd-69WG60aDgg4nWqss,CPFqYi95Is3GwzAdAKtAuFMCXDZFFWC3~uPoidCD67s,AQABAAE/update/";

        public UpdateURICallback(Node node) {
                this.node = node;
@@ -18,8 +15,8 @@
                NodeUpdater nu = node.getNodeUpdater();
                if (nu != null)
                        return nu.getUpdateKey().toString(true);
-               else
-                       return baseURI+Version.buildNumber()+"/";
+               else 
+                       return NodeUpdater.UPDATE_URI;
        }

        public void set(String val) {


Reply via email to