Author: jflesch
Date: 2006-10-09 20:35:41 +0000 (Mon, 09 Oct 2006)
New Revision: 10654

Modified:
   trunk/apps/Thaw/src/thaw/plugins/index/Index.java
Log:
Should fix index update mechanism

Modified: trunk/apps/Thaw/src/thaw/plugins/index/Index.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/index/Index.java   2006-10-08 21:19:49 UTC 
(rev 10653)
+++ trunk/apps/Thaw/src/thaw/plugins/index/Index.java   2006-10-09 20:35:41 UTC 
(rev 10654)
@@ -214,10 +214,12 @@
                try {
                        String newKey;
                        String[] split = key.split("/");
+
                        newKey = split[0] + "/" + split[1] + "/"
                                + 
Integer.toString(Integer.parseInt(split[2])+move) + "/"
                                + split[3];

+                       return newKey;
                } catch (Exception e) {
                        Logger.warning(this, "Unable to add a revision to the 
key '"+key+"' because : "+e.toString());
                }
@@ -254,9 +256,13 @@
                } else {
                        FCPClientGet clientGet;

-                       Logger.info(this, "Getting last version");
+                       Logger.info(this, "Getting lastest version ...");

-                       clientGet = new FCPClientGet(changeRevision(publicKey, 
1), 4, 2, false, System.getProperty("java.io.tmpdir"));
+                       String key = changeRevision(publicKey, 1);
+
+                       Logger.info(this, "Key asked: "+key);
+
+                       clientGet = new FCPClientGet(key, 4, 2, false, 
System.getProperty("java.io.tmpdir"));
                        transfer = clientGet;
                        clientGet.addObserver(this);

@@ -399,6 +405,13 @@
                                }

                        }
+
+                       if (transfer.isFinished() && !transfer.isSuccessful()) {
+                               Logger.info(this, "Unable to get new version of 
the index");
+                               transfer = null;
+                               return;
+                       }
+
                }
        }



Reply via email to