Error reply is kept separate from file type
[jalview.git] / src / jalview / io / IdentifyFile.java
index dbee007..65c0f70 100755 (executable)
@@ -42,6 +42,7 @@ 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
@@ -53,12 +54,11 @@ public class IdentifyFile
             }\r
             else if (protocol.equals("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
             {\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