Author: toad
Date: 2008-01-17 22:30:25 +0000 (Thu, 17 Jan 2008)
New Revision: 17114

Modified:
   trunk/freenet/src/freenet/clients/http/LocalFileInsertToadlet.java
Log:
doh

Modified: trunk/freenet/src/freenet/clients/http/LocalFileInsertToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/LocalFileInsertToadlet.java  
2008-01-17 22:23:48 UTC (rev 17113)
+++ trunk/freenet/src/freenet/clients/http/LocalFileInsertToadlet.java  
2008-01-17 22:30:25 UTC (rev 17114)
@@ -41,12 +41,25 @@
         *      freenet.clients.http.ToadletContext)
         */
        public void handleGet(URI uri, HTTPRequest request, ToadletContext 
toadletContext) throws ToadletContextClosedException, IOException, 
RedirectException {
+               FreenetURI furi = null;
+               String key = request.getParam("key");
+               if(key != null) {
+                       try {
+                               furi = new FreenetURI(key);
+                       } catch (MalformedURLException e) {
+                               furi = null;
+                       }
+               }
+               String extra = "";
+               if(furi != null)
+                       extra = "&key="+furi.toACIIString();
+               
                String path = request.getParam("path");
                if (path.length() == 0) {
                        if (currentPath == null) {
                                currentPath = new 
File(System.getProperty("user.home"));
                        }
-                       writePermanentRedirect(toadletContext, "Found", 
"?path=" + URLEncoder.encode(currentPath.getAbsolutePath(),true));
+                       writePermanentRedirect(toadletContext, "Found", 
"?path=" + URLEncoder.encode(currentPath.getAbsolutePath(),true)+extra);
                        return;
                }

@@ -57,19 +70,6 @@
                        return;
                }

-               FreenetURI furi = null;
-               String key = request.getParam("key");
-               if(key != null) {
-                       try {
-                               furi = new FreenetURI(key);
-                       } catch (MalformedURLException e) {
-                               furi = null;
-                       }
-               }
-               String extra = "";
-               if(furi != null)
-                       extra = "&key="+furi.toACIIString();
-               
                PageMaker pageMaker = toadletContext.getPageMaker();

                HTMLNode pageNode = pageMaker.getPageNode(l10n("listingTitle", 
"path", currentPath.getAbsolutePath()), toadletContext);


Reply via email to