From: gmungoc Date: Wed, 31 Jul 2019 11:59:39 +0000 (+0100) Subject: JAL-3389 add .py to restored Chimera session filename so it opens! X-Git-Tag: Release_2_11_1_0~28^2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=f47d6acd3eb0b61bd292e7bcf970599278666672;p=jalview.git JAL-3389 add .py to restored Chimera session filename so it opens! --- diff --git a/src/jalview/project/Jalview2XML.java b/src/jalview/project/Jalview2XML.java index 0e17779..af48dba 100644 --- a/src/jalview/project/Jalview2XML.java +++ b/src/jalview/project/Jalview2XML.java @@ -3160,25 +3160,25 @@ public class Jalview2XML * @param prefix * a prefix for the temporary file name, must be at least three * characters long - * @param origFile + * @param suffixModel * null or original file - so new file can be given the same suffix * as the old one * @return */ protected String copyJarEntry(jarInputStreamProvider jprovider, - String jarEntryName, String prefix, String origFile) + String jarEntryName, String prefix, String suffixModel) { BufferedReader in = null; PrintWriter out = null; String suffix = ".tmp"; - if (origFile == null) + if (suffixModel == null) { - origFile = jarEntryName; + suffixModel = jarEntryName; } - int sfpos = origFile.lastIndexOf("."); - if (sfpos > -1 && sfpos < (origFile.length() - 3)) + int sfpos = suffixModel.lastIndexOf("."); + if (sfpos > -1 && sfpos < (suffixModel.length() - 1)) { - suffix = "." + origFile.substring(sfpos + 1); + suffix = "." + suffixModel.substring(sfpos + 1); } try { @@ -4444,7 +4444,7 @@ public class Jalview2XML */ String viewerJarEntryName = getViewerJarEntryName(data.getViewId()); chimeraSessionFile = copyJarEntry(jprovider, viewerJarEntryName, - "chimera", null); + "chimera", ".py"); Set> fileData = data.getFileData() .entrySet();