writer = Files.newWriter(jsonFile, Charset.defaultCharset());
writer.append("var treeData = " + tree.toString());
} catch (IOException e) {
throw new SubstepsRuntimeException("Failed writing to detail json file");
} finally {
if (writer != null) {
try {
writer.flush();
writer.close();
} catch (IOException e) {
throw new SubstepsRuntimeException("Failed writing to detail json file");
}
}
}
}