From 2e9cc143fa52dbdbb3e7d56b3612ab708968615a Mon Sep 17 00:00:00 2001 From: jprocter Date: Sun, 14 Nov 2010 14:56:35 +0000 Subject: [PATCH] refactored protocol parser and allow human readable datasource name to be modified --- src/jalview/io/FileParse.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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; + } } -- 1.7.10.2