/** * This method is just an alias for {@link #dumpXml(OutputStream) dumpXml} method. * * @param destination a {@link java.io.OutputStream} object. * @throws java.io.IOException Thrown in case of I/O related error */ public synchronized void exportXml(OutputStream destination) throws IOException { dumpXml(destination); }
/** * This method is just an alias for {@link #dumpXml(String) dumpXml(String)} method. * * @param filename a {@link java.lang.String} object. * @throws java.io.IOException Thrown in case of I/O related error */ public synchronized void exportXml(String filename) throws IOException { dumpXml(filename); }
/** * This method is just an alias for {@link #dumpXml(OutputStream) dumpXml} method. * * @throws IOException Thrown in case of I/O related error */ public synchronized void exportXml(OutputStream destination) throws IOException { dumpXml(destination); }
/** * This method is just an alias for {@link #dumpXml(String) dumpXml(String)} method. * * @throws IOException Thrown in case of I/O related error */ public synchronized void exportXml(String filename) throws IOException { dumpXml(filename); }
/** * Returns string representing internal RRD state in XML format. This format * is fully compatible with RRDTool's XML dump format and can be used for conversion * purposes or debugging. * * @return Internal RRD state in XML format. * @throws java.io.IOException Thrown in case of I/O related error */ public synchronized String getXml() throws IOException { ByteArrayOutputStream destination = new ByteArrayOutputStream(XML_BUFFER_CAPACITY); dumpXml(destination); return destination.toString(); }
/** * <p>Returns string representing internal RRD state in XML format. This format * is fully compatible with RRDTool's XML dump format and can be used for conversion * purposes or debugging.</p> * * @return Internal RRD state in XML format. * @throws IOException Thrown in case of I/O related error */ public synchronized String getXml() throws IOException { ByteArrayOutputStream destination = new ByteArrayOutputStream(XML_BUFFER_CAPACITY); dumpXml(destination); return destination.toString(); }
/** * Dumps internal RRD state to XML file. * Use this XML file to convert your Rrd4j RRD to RRDTool format. * * <p>Suppose that you have a Rrd4j RRD file <code>original.rrd</code> and you want * to convert it to RRDTool format. First, execute the following java code:</p> * * <code>RrdDb rrd = new RrdDb("original.rrd"); * rrd.dumpXml("original.xml");</code> * <p> * Use <code>original.xml</code> file to create the corresponding RRDTool file * (from your command line): * * <code>rrdtool restore copy.rrd original.xml</code> * * @param filename Path to XML file which will be created. * @throws java.io.IOException Thrown in case of I/O related error. */ public synchronized void dumpXml(String filename) throws IOException { try (OutputStream outputStream = new FileOutputStream(filename, false)) { dumpXml(outputStream); } }
/** * Dumps internal RRD state to XML file. * Use this XML file to convert your Rrd4j RRD to RRDTool format. * * <p>Suppose that you have a Rrd4j RRD file <code>original.rrd</code> and you want * to convert it to RRDTool format. First, execute the following java code:</p> * * <code>RrdDb rrd = new RrdDb("original.rrd"); * rrd.dumpXml("original.xml");</code> * * <p>Use <code>original.xml</code> file to create the corresponding RRDTool file * (from your command line): * * <code>rrdtool restore copy.rrd original.xml</code> * * @param filename Path to XML file which will be created. * @throws IOException Thrown in case of I/O related error. */ public synchronized void dumpXml(String filename) throws IOException { OutputStream outputStream = null; try { outputStream = new FileOutputStream(filename, false); dumpXml(outputStream); } finally { if (outputStream != null) { outputStream.close(); } } }