/** * Dumps fetch data to file in XML format. * * @param filepath Path to destination file * @throws java.io.IOException Thrown in case of I/O error */ public void exportXml(String filepath) throws IOException { try(OutputStream outputStream = new FileOutputStream(filepath)) { exportXml(outputStream); } }
/** * Dumps fetch data in XML format. * * @return String containing XML formatted fetch data * @throws java.io.IOException Thrown in case of I/O error */ public String exportXml() throws IOException { ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); exportXml(outputStream); return outputStream.toString(); }
/** * Dumps fetch data in XML format. * * @return String containing XML formatted fetch data * @throws IOException Thrown in case of I/O error */ public String exportXml() throws IOException { ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); exportXml(outputStream); return outputStream.toString(); }
/** * Dumps fetch data to file in XML format. * * @param filepath Path to destination file * @throws IOException Thrown in case of I/O error */ public void exportXml(String filepath) throws IOException { OutputStream outputStream = null; try { outputStream = new FileOutputStream(filepath); exportXml(outputStream); } finally { if (outputStream != null) { outputStream.close(); } } }
println(fetchData.toString()); println("== Dumping fetched data to XML format"); println(fetchData.exportXml()); println("== Fetch completed");