Author: jflesch
Date: 2006-08-09 10:13:11 +0000 (Wed, 09 Aug 2006)
New Revision: 9986

Modified:
   trunk/apps/Thaw/src/thaw/core/Core.java
   trunk/apps/Thaw/src/thaw/core/MainWindow.java
   trunk/apps/Thaw/src/thaw/core/Plugin.java
   trunk/apps/Thaw/src/thaw/fcp/FCPBufferedStream.java
   trunk/apps/Thaw/src/thaw/fcp/FCPConnection.java
   trunk/apps/Thaw/src/thaw/fcp/FCPQuery.java
   trunk/apps/Thaw/src/thaw/plugins/FetchPlugin.java
   trunk/apps/Thaw/src/thaw/plugins/Restarter.java
   trunk/apps/Thaw/src/thaw/plugins/SqlConsole.java
Log:
Add URLDecoder.decode() before starting to download a given key

Modified: trunk/apps/Thaw/src/thaw/core/Core.java
===================================================================
--- trunk/apps/Thaw/src/thaw/core/Core.java     2006-08-09 10:10:41 UTC (rev 
9985)
+++ trunk/apps/Thaw/src/thaw/core/Core.java     2006-08-09 10:13:11 UTC (rev 
9986)
@@ -258,7 +258,7 @@

        /**
         * To call before initGraphics() !
-        * @arg lAndF LookAndFeel name
+        * @param lAndF LookAndFeel name
         */
        public static void setLookAndFeel(String lAndF) {
                lookAndFeel = lAndF;
@@ -349,7 +349,7 @@
        /**
         * End of the world.
         * @param force if true, doesn't check if FCPConnection.isWritting().
-        * @see exit()
+        * @see #exit()
         */
        public void exit(boolean force) {
                if(!force) {

Modified: trunk/apps/Thaw/src/thaw/core/MainWindow.java
===================================================================
--- trunk/apps/Thaw/src/thaw/core/MainWindow.java       2006-08-09 10:10:41 UTC 
(rev 9985)
+++ trunk/apps/Thaw/src/thaw/core/MainWindow.java       2006-08-09 10:13:11 UTC 
(rev 9986)
@@ -34,9 +34,9 @@
  * |----------------------------------|
  * | Tab content                      |
  * |                                  |
- * |?                                 |
  * |                                  |
  * |                                  |
+ * |                                  |
  * ------------------------------------
  * | JLabel (status)                  |
  * ------------------------------------

Modified: trunk/apps/Thaw/src/thaw/core/Plugin.java
===================================================================
--- trunk/apps/Thaw/src/thaw/core/Plugin.java   2006-08-09 10:10:41 UTC (rev 
9985)
+++ trunk/apps/Thaw/src/thaw/core/Plugin.java   2006-08-09 10:13:11 UTC (rev 
9986)
@@ -2,7 +2,7 @@

 /**
  * Define what methods a plugin must implements.
- * WARNING: Constructor will probably not be called (to check).
+ * WARNING: Constructor is NEVER called.
  */
 public interface Plugin {


Modified: trunk/apps/Thaw/src/thaw/fcp/FCPBufferedStream.java
===================================================================
--- trunk/apps/Thaw/src/thaw/fcp/FCPBufferedStream.java 2006-08-09 10:10:41 UTC 
(rev 9985)
+++ trunk/apps/Thaw/src/thaw/fcp/FCPBufferedStream.java 2006-08-09 10:13:11 UTC 
(rev 9986)
@@ -71,7 +71,7 @@
        }

        /**
-        * @see write(byte[])
+        * @see #write(byte[])
         */
        public boolean write(String data) {
                try {

Modified: trunk/apps/Thaw/src/thaw/fcp/FCPConnection.java
===================================================================
--- trunk/apps/Thaw/src/thaw/fcp/FCPConnection.java     2006-08-09 10:10:41 UTC 
(rev 9985)
+++ trunk/apps/Thaw/src/thaw/fcp/FCPConnection.java     2006-08-09 10:13:11 UTC 
(rev 9986)
@@ -15,9 +15,9 @@
  * This object manages directly the socket attached to the node.
  * After being instanciated, you should commit it to the FCPQueryManager, and 
then
  * commit the FCPQueryManager to the FCPQueueManager.
- * Call observer when connected / disconnected.
+ * Call observer when connected / disconnected.<br/>
  * WARNING: This FCP implement don't guarantee that messages are sent in the 
same order than initally put
- *          if the lock on writting is not set !
+ *          if the lock on writting is not set !<br/>
  * TODO: Add functions socketToFile(long size, File file) / fileToSocket(File 
file)
  */
 public class FCPConnection extends Observable {
@@ -315,7 +315,7 @@
        }

        /**
-        * @see read(int, byte[])
+        * @see #read(int, byte[])
         */
        public int read(byte[] buf) {
                return read(buf.length, buf);

Modified: trunk/apps/Thaw/src/thaw/fcp/FCPQuery.java
===================================================================
--- trunk/apps/Thaw/src/thaw/fcp/FCPQuery.java  2006-08-09 10:10:41 UTC (rev 
9985)
+++ trunk/apps/Thaw/src/thaw/fcp/FCPQuery.java  2006-08-09 10:13:11 UTC (rev 
9986)
@@ -1,10 +1,5 @@
 package thaw.fcp;

-
-/**
- * This interface was designed for file query (insertions / downloads)
- * but it's used sometimes for other things.
- */
 public interface FCPQuery {

        /**
@@ -15,7 +10,7 @@
        /**
         * Definitive stop. Transfer is considered as failed.
         * @return false if really it *cannot* stop the query.
-        * @param queueManger QueueManager gives access to QueryManager.
+        * @param queueManager QueueManager gives access to QueryManager.
         */
        public boolean stop(FCPQueueManager queueManager);


Modified: trunk/apps/Thaw/src/thaw/plugins/FetchPlugin.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/FetchPlugin.java   2006-08-09 10:10:41 UTC 
(rev 9985)
+++ trunk/apps/Thaw/src/thaw/plugins/FetchPlugin.java   2006-08-09 10:13:11 UTC 
(rev 9986)
@@ -57,6 +57,12 @@
                        String[] subKey = keys[i].split("\\?"); /* Because of 
VolodyA :p */

                        String key = 
subKey[0].replaceFirst("http://127.0.0.1:8888/";, "");
+                       
+                       try {
+                               key = java.net.URLDecoder.decode(key, "UTF-8");
+                       } catch (java.io.UnsupportedEncodingException e) {
+                               Logger.warning(this, 
"UnsupportedEncodingException (UTF-8): "+e.toString());
+                       }

                        core.getQueueManager().addQueryToThePendingQueue(new 
FCPClientGet(key,
                                                                                
          priority,

Modified: trunk/apps/Thaw/src/thaw/plugins/Restarter.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/Restarter.java     2006-08-09 10:10:41 UTC 
(rev 9985)
+++ trunk/apps/Thaw/src/thaw/plugins/Restarter.java     2006-08-09 10:13:11 UTC 
(rev 9986)
@@ -18,6 +18,7 @@
 /**
  * This plugin, after a given time, restart all/some the failed downloads (if 
maxDownloads >= 0, downloads to restart are choosen randomly).
  * A not too bad example to show how to make plugins.
+ * @deprecated When this plugin was created, MaxRetries was stupidly set to 0 
instead of -1 => now this plugin is useless.
  */
 public class Restarter implements Observer, Runnable, Plugin {


Modified: trunk/apps/Thaw/src/thaw/plugins/SqlConsole.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/SqlConsole.java    2006-08-09 10:10:41 UTC 
(rev 9985)
+++ trunk/apps/Thaw/src/thaw/plugins/SqlConsole.java    2006-08-09 10:13:11 UTC 
(rev 9986)
@@ -13,6 +13,8 @@

 import java.awt.Font;

+import thaw.plugins.index.TableCreator;
+
 import thaw.core.*;
 import thaw.fcp.*;

@@ -151,14 +153,33 @@
                                addToConsole("Ok\n");
                                return;
                        }
+                       
+                       ResultSet result;

-                       ResultSet result = hsqldb.executeQuery(cmd);
+                       if(!cmd.toLowerCase().equals("drop_tables"))
+                               result = hsqldb.executeQuery(cmd);
+                       else {
+                               TableCreator.dropTables(hsqldb);
+                               addToConsole("Ok\n");
+                               return;
+                       }
+                               

                        if(result == null) {
                                addToConsole("(null)\n");
                                return;
                        }

+                       try {
+                               if(result.getFetchSize() == 0) {
+                                       addToConsole("(done)\n");
+                                       return;
+                               }
+                       } catch(java.sql.SQLException e) {
+                               addToConsole("(SE)\n");
+                               return;
+                       }
+
                        java.sql.SQLWarning warning = result.getWarnings();

                        while(warning != null) {


Reply via email to