X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FIdentifyFile.java;h=46899da400da56c3b638fc245d130e16d64ce532;hb=cd5b2de469fb4c09242955cb4b74279e2da348d6;hp=7293ac6927a9310c8dc49e54f3ffca815efeb765;hpb=4932106f045349290d58ab38d216dff31fd9afce;p=jalview.git diff --git a/src/jalview/io/IdentifyFile.java b/src/jalview/io/IdentifyFile.java index 7293ac6..46899da 100755 --- a/src/jalview/io/IdentifyFile.java +++ b/src/jalview/io/IdentifyFile.java @@ -40,6 +40,7 @@ public class IdentifyFile */ public String Identify(String file, String protocol) { + String emessage = "UNIDENTIFIED FILE PARSING ERROR"; FileParse parser = null; try { parser = new FileParse(file, protocol); @@ -49,10 +50,11 @@ public class IdentifyFile } catch (Exception e) { System.err.println("Error whilst identifying"); e.printStackTrace(System.err); + emessage = e.getMessage(); } if (parser!=null) return parser.errormessage; - return "UNIDENTIFIED FILE PARSING ERROR"; + return emessage; } public String Identify(FileParse source) { return Identify(source, true); // preserves original behaviour prior to version 2.3 @@ -70,6 +72,10 @@ public class IdentifyFile boolean lineswereskipped=false; boolean isBinary = false; // true if length is non-zero and non-printable characters are encountered try { + if (!closeSource) + { + source.mark(); + } while ( (data = source.nextLine()) != null) { length+=data.length(); @@ -165,6 +171,7 @@ public class IdentifyFile else { reply = "FASTA"; + // TODO : AMSA File is indicated if there is annotation in the FASTA file - but FASTA will automatically generate this at the mo. } } break;