Formatting changes
[jalview.git] / src / jalview / io / EBIFetchClient.java
index 5b21bfe..2c829ff 100755 (executable)
@@ -32,83 +32,151 @@ import javax.xml.namespace.QName;
 import javax.xml.rpc.ParameterMode;\r
 \r
 \r
-public class EBIFetchClient {\r
+/**\r
+ * DOCUMENT ME!\r
+ *\r
+ * @author $author$\r
+ * @version $Revision$\r
+ */\r
+public class EBIFetchClient\r
+{\r
     Call call;\r
     String format = "default";\r
     String style = "raw";\r
 \r
-    public EBIFetchClient() {\r
-        try {\r
+    /**\r
+     * Creates a new EBIFetchClient object.\r
+     */\r
+    public EBIFetchClient()\r
+    {\r
+        try\r
+        {\r
             call = (Call) new Service().createCall();\r
             call.setTargetEndpointAddress(new java.net.URL(\r
                     "http://www.ebi.ac.uk/ws/services/Dbfetch"));\r
-        } catch (Exception ex) {\r
+        }\r
+        catch (Exception ex)\r
+        {\r
         }\r
     }\r
 \r
-    public String[] getSupportedDBs() {\r
-        try {\r
+    /**\r
+     * DOCUMENT ME!\r
+     *\r
+     * @return DOCUMENT ME!\r
+     */\r
+    public String[] getSupportedDBs()\r
+    {\r
+        try\r
+        {\r
             call.setOperationName(new QName("urn:Dbfetch", "getSupportedDBs"));\r
             call.setReturnType(XMLType.SOAP_ARRAY);\r
 \r
             return (String[]) call.invoke(new Object[] {  });\r
-        } catch (Exception ex) {\r
+        }\r
+        catch (Exception ex)\r
+        {\r
             return null;\r
         }\r
     }\r
 \r
-    public String[] getSupportedFormats() {\r
-        try {\r
+    /**\r
+     * DOCUMENT ME!\r
+     *\r
+     * @return DOCUMENT ME!\r
+     */\r
+    public String[] getSupportedFormats()\r
+    {\r
+        try\r
+        {\r
             call.setOperationName(new QName("urn:Dbfetch", "getSupportedFormats"));\r
             call.setReturnType(XMLType.SOAP_ARRAY);\r
 \r
             return (String[]) call.invoke(new Object[] {  });\r
-        } catch (Exception ex) {\r
+        }\r
+        catch (Exception ex)\r
+        {\r
             return null;\r
         }\r
     }\r
 \r
-    public String[] getSupportedStyles() {\r
-        try {\r
+    /**\r
+     * DOCUMENT ME!\r
+     *\r
+     * @return DOCUMENT ME!\r
+     */\r
+    public String[] getSupportedStyles()\r
+    {\r
+        try\r
+        {\r
             call.setOperationName(new QName("urn:Dbfetch", "getSupportedStyles"));\r
             call.setReturnType(XMLType.SOAP_ARRAY);\r
 \r
             return (String[]) call.invoke(new Object[] {  });\r
-        } catch (Exception ex) {\r
+        }\r
+        catch (Exception ex)\r
+        {\r
             return null;\r
         }\r
     }\r
 \r
-    public String[] fetchData(String ids, String f, String s) {\r
+    /**\r
+     * DOCUMENT ME!\r
+     *\r
+     * @param ids DOCUMENT ME!\r
+     * @param f DOCUMENT ME!\r
+     * @param s DOCUMENT ME!\r
+     *\r
+     * @return DOCUMENT ME!\r
+     */\r
+    public String[] fetchData(String ids, String f, String s)\r
+    {\r
         // ids should be of the form uniprot:25KD_SARPE;ADHR_DROPS;\r
         // max 50 ids can be added at one time\r
-        try {\r
+        try\r
+        {\r
             call.setOperationName(new QName("urn:Dbfetch", "fetchData"));\r
             call.addParameter("query", XMLType.XSD_STRING, ParameterMode.IN);\r
             call.addParameter("format", XMLType.XSD_STRING, ParameterMode.IN);\r
             call.addParameter("style", XMLType.XSD_STRING, ParameterMode.IN);\r
             call.setReturnType(XMLType.SOAP_ARRAY);\r
 \r
-            if (f != null) {\r
+            if (f != null)\r
+            {\r
                 format = f;\r
             }\r
 \r
-            if (s != null) {\r
+            if (s != null)\r
+            {\r
                 style = s;\r
             }\r
 \r
             return (String[]) call.invoke(new Object[] { ids, format, style });\r
-        } catch (Exception ex) {\r
+        }\r
+        catch (Exception ex)\r
+        {\r
             return null;\r
         }\r
     }\r
 \r
-    public String fetchDataFile(String arg, String f, String s) {\r
-        if (f != null) {\r
+    /**\r
+     * DOCUMENT ME!\r
+     *\r
+     * @param arg DOCUMENT ME!\r
+     * @param f DOCUMENT ME!\r
+     * @param s DOCUMENT ME!\r
+     *\r
+     * @return DOCUMENT ME!\r
+     */\r
+    public String fetchDataFile(String arg, String f, String s)\r
+    {\r
+        if (f != null)\r
+        {\r
             format = f;\r
         }\r
 \r
-        if (s != null) {\r
+        if (s != null)\r
+        {\r
             style = s;\r
         }\r
 \r
@@ -124,21 +192,25 @@ public class EBIFetchClient {
 \r
         call.setReturnType(qnameAttachment);\r
 \r
-        try {\r
+        try\r
+        {\r
             Object ret = call.invoke(new Object[] { arg, format, style });\r
 \r
-            if (null == ret) {\r
+            if (null == ret)\r
+            {\r
                 System.err.println("Received null ");\r
                 throw new AxisFault("", "Received null", null, null);\r
             }\r
 \r
-            if (ret instanceof String) {\r
+            if (ret instanceof String)\r
+            {\r
                 System.err.println("Received problem response from server: " +\r
                     ret);\r
                 throw new AxisFault("", (String) ret, null, null);\r
             }\r
 \r
-            if (!(ret instanceof DataHandler)) {\r
+            if (!(ret instanceof DataHandler))\r
+            {\r
                 //The wrong type of object that what was expected.\r
                 System.err.println("Received problem response from server:" +\r
                     ret.getClass().getName());\r
@@ -153,20 +225,28 @@ public class EBIFetchClient {
             //From here we'll just treat the data resource as file.\r
             String receivedfileName = rdh.getName(); //Get the filename.\r
 \r
-            if (receivedfileName == null) {\r
+            if (receivedfileName == null)\r
+            {\r
                 System.err.println("Could not get the file name.");\r
                 throw new AxisFault("", "Could not get the file name.", null,\r
                     null);\r
             }\r
 \r
-            if (arg.equalsIgnoreCase("medline")) {\r
+            if (arg.equalsIgnoreCase("medline"))\r
+            {\r
                 return receivedfileName;\r
-            } else if (arg.equalsIgnoreCase("interpro")) {\r
+            }\r
+            else if (arg.equalsIgnoreCase("interpro"))\r
+            {\r
                 return receivedfileName;\r
-            } else {\r
+            }\r
+            else\r
+            {\r
                 System.err.println(receivedfileName);\r
             }\r
-        } catch (Exception ex) {\r
+        }\r
+        catch (Exception ex)\r
+        {\r
             ex.printStackTrace();\r
         }\r
 \r