X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fio%2FAppletFormatAdapter.java;h=0709a2f93eb77de0171f0d0fb15a7826718662a5;hb=3f72d101fbeb83a7526a3c4f8f62cfe8e8a0189d;hp=b1952a9fc66e060730fa6a936a09f5db844b1c62;hpb=8a6fa9ea9900d0f106529c3f6283e7f9d76dd2cb;p=jalview.git diff --git a/src/jalview/io/AppletFormatAdapter.java b/src/jalview/io/AppletFormatAdapter.java index b1952a9..0709a2f 100755 --- a/src/jalview/io/AppletFormatAdapter.java +++ b/src/jalview/io/AppletFormatAdapter.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. * @@ -67,7 +67,7 @@ public class AppletFormatAdapter */ public static final String[] READABLE_EXTENSIONS = new String[] { "fa, fasta, fastq", "aln", "pfam", "msf", "pir", "blc", "amsa", "jar", - "sto" }; // , + "sto,stk" }; // , // ".blast" // }; @@ -117,7 +117,18 @@ public class AppletFormatAdapter AlignFile afile = null; String inFile; - + /** + * character used to write newlines + */ + protected String newline = System.getProperty("line.separator"); + public void setNewlineString(String nl) + { + newline = nl; + } + public String getNewlineString() + { + return newline; + } /** * check that this format is valid for reading * @@ -441,7 +452,7 @@ public class AppletFormatAdapter throw new Exception( "Implementation error: Unknown file format string"); } - + afile.setNewlineString(newline); afile.addJVSuffix(jvsuffix); afile.setSeqs(alignment.getSequencesArray()); @@ -463,6 +474,17 @@ public class AppletFormatAdapter return null; } + public static String checkProtocol(String file) + { + String protocol = FILE; + String ft = file.toLowerCase().trim(); + if (ft.indexOf("http:") ==0 || ft.indexOf("https:") ==0 || ft.indexOf("file:") == 0) + { + protocol = URL; + } + return protocol; + } + public static void main(String[] args) { int i = 0;