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