apply version 2.7 copyright
[jalview.git] / src / jalview / io / AppletFormatAdapter.java
index 5eb4d2b..635c801 100755 (executable)
@@ -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, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -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());
@@ -466,8 +477,8 @@ public class AppletFormatAdapter
   public static String checkProtocol(String file)
   {
     String protocol = FILE;
-  
-    if (file.indexOf("http:") > -1 || file.indexOf("file:") > -1)
+    String ft = file.toLowerCase().trim();
+    if (ft.indexOf("http:") ==0 || ft.indexOf("https:") ==0 || ft.indexOf("file:") == 0)
     {
       protocol = URL;
     }