refactored protocol parser and allow human readable datasource name to be modified
authorjprocter <Jim Procter>
Sun, 14 Nov 2010 14:56:35 +0000 (14:56 +0000)
committerjprocter <Jim Procter>
Sun, 14 Nov 2010 14:56:35 +0000 (14:56 +0000)
src/jalview/io/FileParse.java

index 4670d99..e972679 100755 (executable)
@@ -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;
+  }
 }