ignore case when examining the file extension for guessing the mime-type
[pithos] / src / gr / ebs / gss / client / FileUploadDialog.java
index 662d057..fbcbffa 100644 (file)
@@ -99,8 +99,8 @@ public class FileUploadDialog extends DialogBox implements Updateable {
                VerticalPanel panel = new VerticalPanel();\r
                form.setWidget(panel);\r
                final HTML info = new HTML("You may select a file to upload. Install" +\r
-                               " <a href='http://gears.google.com/'>Google Gears</a><br> " +\r
-                               "for uploading multiple files simultaneously.");\r
+                               " <a href='http://gears.google.com/' target='_blank'>Google " +\r
+                               "Gears</a><br> for uploading multiple files simultaneously.");\r
                info.addStyleName("gss-uploadNote");\r
                panel.add(info);\r
                final Hidden date = new Hidden("Date", "");\r
@@ -220,8 +220,7 @@ public class FileUploadDialog extends DialogBox implements Updateable {
                                        GSS.get().displayError(results);\r
                                }\r
                                progressBar.setProgress(100);\r
-                               repeater.finish();\r
-                               hide();\r
+                               cancelUpload();\r
                                GSS.get().showFileList(true);\r
                                GSS.get().getStatusPanel().updateStats();\r
                        }\r
@@ -247,8 +246,7 @@ public class FileUploadDialog extends DialogBox implements Updateable {
                                prepareAndSubmit();\r
                                break;\r
                        case KeyboardListener.KEY_ESCAPE:\r
-                               repeater.finish();\r
-                               hide();\r
+                               cancelUpload();\r
                                break;\r
                }\r
 \r
@@ -256,6 +254,14 @@ public class FileUploadDialog extends DialogBox implements Updateable {
        }\r
 \r
        /**\r
+        * Cancels the file upload.\r
+        */\r
+       private void cancelUpload() {\r
+               repeater.finish();\r
+               hide();\r
+       }\r
+\r
+       /**\r
         * Make any last minute checks and start the upload.\r
         */\r
        public void prepareAndSubmit() {\r
@@ -493,11 +499,8 @@ public class FileUploadDialog extends DialogBox implements Updateable {
         * Same as URL.encodeComponent, but also\r
         * encode apostrophe since browsers aren't consistent about it\r
         * (FF encodes, IE does not).\r
-        *\r
-        * @param decodedURLComponent\r
-        * @return\r
         */\r
-       protected String encodeComponent(String decodedURLComponent) {\r
+       private String encodeComponent(String decodedURLComponent) {\r
                String retv = URL.encodeComponent(decodedURLComponent);\r
                retv = retv.replaceAll("'", "%27");\r
                return retv;\r