remove any trailing '/' from the URL before validation and acceptance
authorjprocter <jprocter@compbio.dundee.ac.uk>
Wed, 17 Aug 2011 13:44:30 +0000 (14:44 +0100)
committerjprocter <jprocter@compbio.dundee.ac.uk>
Wed, 17 Aug 2011 13:45:35 +0000 (14:45 +0100)
src/jalview/gui/WsPreferences.java

index e14b358..b88f27e 100644 (file)
@@ -262,8 +262,14 @@ public class WsPreferences extends GWsPreferences
       {
         // TODO: do a better job of checking that the url is a valid discovery
         // URL for web services.
-        foo = new URL(urltf.getText().trim());
+        String tx = urltf.getText().trim();
+        while (tx.length()>0 && tx.lastIndexOf('/')==tx.length()-1)
+        {
+          tx = tx.substring(0, tx.length()-1);
+        }
+        foo = new URL(tx);
         valid = true;
+        urltf.setText(tx);
       } catch (Exception e)
       {
         valid = false;