// Create a new workbook Workbook workbook = new Workbook(); InputStream fileStream = this.getResourceStream("json/TableSheets.json"); workbook.fromJson(fileStream); // Create to a ssjson file stream FileOutputStream outputStream = null; try { outputStream = new FileOutputStream("TableSheets.ssjson"); } catch (FileNotFoundException e) { e.printStackTrace(); } workbook.toJson(outputStream); // Close the ssjson stream try { outputStream.close(); } catch (IOException e) { e.printStackTrace(); }
// Create a new workbook var workbook = Workbook() val fileStream: InputStream? = this.getResourceStream("json/PivotTableViews.json") workbook.fromJson(fileStream) // Create to a ssjson file stream var outputStream: FileOutputStream? = null try { outputStream = FileOutputStream("TableSheets.ssjson"); } catch (e: FileNotFoundException) { e.printStackTrace() } workbook.toJson(outputStream) // Close the ssjson stream try { if(outputStream != null){ outputStream.close() } } catch (e: IOException) { e.printStackTrace() }