Report invalid chars
[jalview.git] / src / jalview / io / BLCFile.java
index a7cc1ea..56d40f9 100755 (executable)
@@ -77,7 +77,7 @@ public class BLCFile extends AlignFile
     /**\r
      * DOCUMENT ME!\r
      */\r
-    public void parse()\r
+    public void parse() throws IOException\r
     {\r
         boolean idsFound = false;\r
         Vector ids = new Vector();\r
@@ -87,8 +87,6 @@ public class BLCFile extends AlignFile
 \r
         String line = null;\r
 \r
-        try\r
-        {\r
             do\r
             {\r
                 line = nextLine();\r
@@ -146,17 +144,23 @@ public class BLCFile extends AlignFile
 \r
             for (int i = 0; i < ids.size(); i++)\r
             {\r
-                Sequence newSeq = new Sequence(ids.elementAt(i).toString(),\r
-                        seqstrings[i].toString(),\r
-                        Integer.parseInt(starts.elementAt(i).toString()),\r
-                        Integer.parseInt(ends.elementAt(i).toString()));\r
+              Sequence newSeq = new Sequence(ids.elementAt(i).toString(),\r
+                                             seqstrings[i].toString(),\r
+                                             Integer.parseInt(starts.elementAt(i).\r
+                                                              toString()),\r
+                                             Integer.parseInt(ends.elementAt(i).toString()));\r
+\r
+              if (!isValidProteinSequence(newSeq.getSequence()))\r
+              {\r
+                throw new IOException(AppletFormatAdapter.INVALID_CHARACTERS\r
+                               +" : "+ newSeq.getName()\r
+                               +" : "+invalidCharacter);\r
+\r
+              }\r
+\r
                 seqs.addElement(newSeq);\r
             }\r
-        }\r
-        catch (Exception ex)\r
-        {\r
-            ex.printStackTrace();\r
-        }\r
+\r
     }\r
 \r
     /**\r