X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FFileParse.java;fp=src%2Fjalview%2Fio%2FFileParse.java;h=8e9a49c3650580717496bf6a736c4544beaf966a;hb=bdba25716eaa9492681532cb443c18ed34237488;hp=e8e9f2ef6ffd9a17cdab241ec7542513ad309b09;hpb=77abb3fac2965a8966410cd77cd749c7c1dc6453;p=jalview.git diff --git a/src/jalview/io/FileParse.java b/src/jalview/io/FileParse.java index e8e9f2e..8e9a49c 100755 --- a/src/jalview/io/FileParse.java +++ b/src/jalview/io/FileParse.java @@ -20,6 +20,8 @@ */ package jalview.io; +import jalview.util.MessageManager; + import java.io.*; import java.net.*; import java.util.zip.GZIPInputStream; @@ -94,8 +96,7 @@ public class FileParse { if (from == null) { - throw new Error( - "Implementation error. Null FileParse in copy constructor"); + throw new Error(MessageManager.getString("error.implementation_error_null_fileparse")); } if (from == this) return; @@ -208,7 +209,7 @@ public class FileParse { if (e != null) { - throw new IOException("Failed to resolve GZIP stream", e); + throw new IOException(MessageManager.getString("exception.failed_to_resolve_gzip_stream"), e); } throw q; } @@ -263,14 +264,12 @@ public class FileParse { if (checkFileSource(suffixLess)) { - throw new IOException("Problem opening " + inFile - + " (also tried " + suffixLess + ") : " + errormessage); + throw new IOException(MessageManager.formatMessage("exception.problem_opening_file_also_tried", new String[]{inFile.getName(),suffixLess,errormessage})); } } else { - throw new IOException("Problem opening " + inFile + " : " - + errormessage); + throw new IOException(MessageManager.formatMessage("exception.problem_opening_file", new String[]{inFile.getName(),errormessage})); } } } @@ -345,8 +344,7 @@ public class FileParse if (dataIn == null || error) { // pass up the reason why we have no source to read from - throw new IOException("Failed to read data from source:\n" - + errormessage); + throw new IOException(MessageManager.formatMessage("exception.failed_to_read_data_from_source", new String[]{errormessage})); } error = false; dataIn.mark(READAHEAD_LIMIT); @@ -366,7 +364,7 @@ public class FileParse } else { - throw new IOException("Unitialised Source Stream"); + throw new IOException(MessageManager.getString("exception.no_init_source_stream")); } } @@ -374,7 +372,7 @@ public class FileParse { if (!error) return dataIn.readLine(); - throw new IOException("Invalid Source Stream:" + errormessage); + throw new IOException(MessageManager.formatMessage("exception.invalid_source_stream", new String[]{errormessage})); } public boolean isValid() @@ -406,8 +404,7 @@ public class FileParse } else { - throw new IOException( - "Implementation Error: Reset called for invalid source."); + throw new IOException(MessageManager.getString("error.implementation_error_reset_called_for_invalid_source")); } }