exportData.getStartEndPostions(), ap
.getAlignViewport().getColumnSelection());
- String bioJSTemplateString = getBioJsTemplateAsString();
+ String bioJSTemplateString = HtmlFile.readFileAsString(getCurrentBJSTemplateFile());
String generatedBioJsWithJalviewAlignmentAsJson = bioJSTemplateString
.replaceAll("#sequenceData#", bioJSON).toString();
return selectedFile;
}
- public static String getBioJsTemplateAsString() throws IOException
- {
- InputStreamReader isReader = null;
- BufferedReader buffReader = null;
- StringBuilder sb = new StringBuilder();
- Objects.requireNonNull(getCurrentBJSTemplateFile(),
- "BioJsTemplate File not initialized!");
- @SuppressWarnings("deprecation")
- URL url = getCurrentBJSTemplateFile().toURL();
- if (url != null)
- {
- try
- {
- isReader = new InputStreamReader(url.openStream());
- buffReader = new BufferedReader(isReader);
- String line;
- String lineSeparator = System.getProperty("line.separator");
- while ((line = buffReader.readLine()) != null)
- {
- sb.append(line).append(lineSeparator);
- }
-
- } catch (Exception ex)
- {
- ex.printStackTrace();
- } finally
- {
- if (isReader != null)
- {
- isReader.close();
- }
-
- if (buffReader != null)
- {
- buffReader.close();
- }
- }
- }
- return sb.toString();
- }
public static void refreshBioJSVersionsInfo(String dirName)
throws URISyntaxException