Jalview 2.6 source licence
[jalview.git] / src / jalview / gui / Jalview2XML_V1.java
index ca2db7b..3cde3bb 100755 (executable)
@@ -1,20 +1,19 @@
 /*\r
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4)\r
- * Copyright (C) 2008 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6)\r
+ * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
  * \r
- * This program is free software; you can redistribute it and/or\r
- * modify it under the terms of the GNU General Public License\r
- * as published by the Free Software Foundation; either version 2\r
- * of the License, or (at your option) any later version.\r
+ * This file is part of Jalview.\r
  * \r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- * GNU General Public License for more details.\r
+ * Jalview is free software: you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License \r
+ * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\r
  * \r
- * You should have received a copy of the GNU General Public License\r
- * along with this program; if not, write to the Free Software\r
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA\r
+ * Jalview is distributed in the hope that it will be useful, but \r
+ * WITHOUT ANY WARRANTY; without even the implied warranty \r
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR \r
+ * PURPOSE.  See the GNU General Public License for more details.\r
+ * \r
+ * You should have received a copy of the GNU General Public License along with Jalview.  If not, see <http://www.gnu.org/licenses/>.\r
  */\r
 package jalview.gui;\r
 \r
@@ -28,6 +27,7 @@ import javax.swing.*;
 import org.exolab.castor.xml.*;\r
 import jalview.binding.*;\r
 import jalview.schemes.*;\r
+import jalview.util.jarInputStreamProvider;\r
 \r
 /**\r
  * DOCUMENT ME!\r
@@ -81,37 +81,22 @@ public class Jalview2XML_V1
    * DOCUMENT ME!\r
    * \r
    * @param file\r
-   *                DOCUMENT ME!\r
+   *          DOCUMENT ME!\r
    */\r
-  public AlignFrame LoadJalviewAlign(final String file)\r
+  public AlignFrame LoadJalviewAlign(final jarInputStreamProvider jprovider)\r
   {\r
-\r
+    final String file = jprovider.getFilename();\r
     jalview.gui.AlignFrame af = null;\r
 \r
     try\r
     {\r
-      // UNMARSHALLER SEEMS TO CLOSE JARINPUTSTREAM, MOST ANNOYING\r
-      URL url = null;\r
-\r
-      if (file.startsWith("http://"))\r
-      {\r
-        url = new URL(file);\r
-      }\r
-\r
       JarInputStream jin = null;\r
       JarEntry jarentry = null;\r
       int entryCount = 1;\r
 \r
       do\r
       {\r
-        if (url != null)\r
-        {\r
-          jin = new JarInputStream(url.openStream());\r
-        }\r
-        else\r
-        {\r
-          jin = new JarInputStream(new FileInputStream(file));\r
-        }\r
+        jin = jprovider.getJarInputStream();\r
 \r
         for (int i = 0; i < entryCount; i++)\r
         {\r