From: gmungoc Date: Fri, 23 Oct 2015 09:30:56 +0000 (+0100) Subject: JAL-1943 don't try to unmarshal non-xml files in V1 project X-Git-Tag: Release_2_10_0~345 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=e96baa5041aa2b8c6d2f7454bf869d0122def51e;p=jalview.git JAL-1943 don't try to unmarshal non-xml files in V1 project --- diff --git a/src/jalview/gui/Jalview2XML_V1.java b/src/jalview/gui/Jalview2XML_V1.java index b551f5d..61e20fa 100755 --- a/src/jalview/gui/Jalview2XML_V1.java +++ b/src/jalview/gui/Jalview2XML_V1.java @@ -44,6 +44,8 @@ import jalview.util.jarInputStreamProvider; import jalview.viewmodel.seqfeatures.FeatureRendererSettings; import java.io.InputStreamReader; +import java.io.Reader; +import java.net.UnknownHostException; import java.util.Hashtable; import java.util.Vector; import java.util.jar.JarEntry; @@ -51,8 +53,6 @@ import java.util.jar.JarInputStream; import javax.swing.JOptionPane; -import org.exolab.castor.xml.IDResolver; - /** * DOCUMENT ME! * @@ -127,33 +127,29 @@ public class Jalview2XML_V1 jarentry = jin.getNextJarEntry(); } - class NoDescIDResolver implements IDResolver - { - public Object resolve(String idref) - { - System.out.println(idref + " used"); - return null; - } - } - if (jarentry != null) { - InputStreamReader in = new InputStreamReader(jin, "UTF-8"); - JalviewModel object = new JalviewModel(); + entryCount++; + if (jarentry.getName().endsWith(".xml")) + { + Reader in = new InputStreamReader(jin, "UTF-8"); + JalviewModel object = new JalviewModel(); - object = object.unmarshal(in); + object = object.unmarshal(in); - af = LoadFromObject(object, file); - entryCount++; + af = LoadFromObject(object, file); + } } + jin.close(); } while (jarentry != null); - } catch (final java.net.UnknownHostException ex) + } catch (final UnknownHostException ex) { ex.printStackTrace(); if (raiseGUI) { javax.swing.SwingUtilities.invokeLater(new Runnable() { + @Override public void run() { @@ -176,6 +172,7 @@ public class Jalview2XML_V1 { javax.swing.SwingUtilities.invokeLater(new Runnable() { + @Override public void run() {