From: jprocter Date: Sun, 14 Nov 2010 14:56:35 +0000 (+0000) Subject: refactored protocol parser and allow human readable datasource name to be modified X-Git-Tag: Release_2_7~382 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=2e9cc143fa52dbdbb3e7d56b3612ab708968615a;p=jalview.git refactored protocol parser and allow human readable datasource name to be modified --- diff --git a/src/jalview/io/FileParse.java b/src/jalview/io/FileParse.java index 4670d99..e972679 100755 --- a/src/jalview/io/FileParse.java +++ b/src/jalview/io/FileParse.java @@ -374,6 +374,14 @@ public class FileParse { return dataName; } + /** + * set the (human readable) name or URI for this datasource + * @param dataname + */ + protected void setDataName(String dataname) { + dataName = dataname; + } + public Reader getReader() throws IOException { @@ -383,4 +391,15 @@ public class FileParse } 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; + } }