public void buildAmpieDataXML(String available, String used) throws FileNotFoundException, IOException {
/ m7 Z& `0 H a/ x+ S4 } Element root = new Element(”pie”);: F, R. @8 t1 R+ u2 ^+ w
root.addContent(new Element(”slice”).setAttribute(”title”, “可用空间”).setText(available));& R9 c% \) @2 K8 L) ?
root.addContent(new Element(”slice”).setAttribute(”title”, “已用空间”).setText(used));# y! Y) r1 p1 K" n- O
Document doc = new Document(root);* ~: W9 I6 p/ h0 @
Format format = Format.getPrettyFormat();4 d5 ~0 y$ [2 Q/ q/ b
XMLOutputter XMLOut = new XMLOutputter(format);
* n! j. t$ X% R( x0 I7 s XMLOut.output(doc, new FileOutputStream(”/work/resin/webapps/auth-cgi/scripts/amchart/ampie/ampie_data.xml”));; E/ ~0 Y7 b/ A! H" ?/ Z* z5 R: [- D
} |