Use equalsIgnoreCase
[jalview.git] / src / jalview / io / IdentifyFile.java
index dbee007..729a860 100755 (executable)
@@ -42,25 +42,25 @@ public class IdentifyFile
     public static String Identify(String file, String protocol)\r
     {\r
         String reply = "PFAM";\r
+        String error =  "FILE NOT FOUND";\r
 \r
         try\r
         {\r
             BufferedReader reader = null;\r
 \r
-            if (protocol.equals("File"))\r
+            if (protocol.equalsIgnoreCase("File"))\r
             {\r
                 reader = new BufferedReader(new FileReader(file));\r
             }\r
-            else if (protocol.equals("URL"))\r
+            else if (protocol.equalsIgnoreCase("URL"))\r
             {\r
-                reply = "URL NOT FOUND";\r
-\r
+                error = "URL NOT FOUND";\r
                 URL url = new URL(file);\r
                 reader = new BufferedReader(new InputStreamReader(\r
                             url.openStream()));\r
-                reply = "error";\r
+\r
             }\r
-            else if (protocol.equals("Paste"))\r
+            else if (protocol.equalsIgnoreCase("Paste"))\r
             {\r
                 reader = new BufferedReader(new StringReader(file));\r
             }\r
@@ -128,8 +128,8 @@ public class IdentifyFile
         catch (Exception ex)\r
         {\r
             System.err.println("File Identification failed!\n" + ex);\r
+            return error;\r
         }\r
-\r
         return reply;\r
     }\r
 }\r