X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FFileParse.java;h=05a7212b5fba1692407ded180b6e2be9f6e29be9;hb=e015538903c8cabb2b90dd030e3e0c419a730db9;hp=e97267947fb5d1bf9fe35a6b0852963f9e7e47d2;hpb=2e9cc143fa52dbdbb3e7d56b3612ab708968615a;p=jalview.git diff --git a/src/jalview/io/FileParse.java b/src/jalview/io/FileParse.java index e972679..05a7212 100755 --- a/src/jalview/io/FileParse.java +++ b/src/jalview/io/FileParse.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6) - * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7) + * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle * * This file is part of Jalview. * @@ -38,7 +38,18 @@ public class FileParse // same data source protected char suffixSeparator = '#'; - + /** + * character used to write newlines + */ + protected String newline = System.getProperty("line.separator"); + public void setNewlineString(String nl) + { + newline = nl; + } + public String getNewlineString() + { + return newline; + } /** * '#' separated string tagged on to end of filename or url that was clipped * off to resolve to valid filename @@ -383,23 +394,17 @@ public class FileParse } - public Reader getReader() throws IOException + /** + * get the underlying bufferedReader for this data source. + * @return null if no reader available + * @throws IOException + */ + public Reader getReader() { - if (dataIn != null && dataIn.ready()) + if (dataIn != null) // Probably don't need to test for readiness && dataIn.ready()) { return dataIn; } return null; } - - public static String checkProtocol(String file) - { - String protocol = jalview.io.FormatAdapter.FILE; - - if (file.indexOf("http:") > -1 || file.indexOf("file:") > -1) - { - protocol = jalview.io.FormatAdapter.URL; - } - return protocol; - } }