ask user if they want to run the JabaWS tester on new URLs
[jalview.git] / src / jalview / ws / jws2 / Jws2Discoverer.java
index 9897d79..cb1f49b 100644 (file)
@@ -482,4 +482,28 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
             : new Vector<Jws2Instance>(services);
   }
 
+  /**
+   * test the given URL with the JabaWS test code
+   * @param foo
+   * @return
+   */
+  public static boolean testServiceUrl(URL foo)
+  {
+    try {
+      compbio.ws.client.WSTester.main(new String[] { "-h="+foo.toString()});
+    } catch (Exception e)
+    {
+      return false;
+    }
+    catch (OutOfMemoryError e)
+    {
+      return false;
+    }
+    catch (Error e)
+    {
+      return false;
+    }
+    return true;
+  }
+
 }