public void buildAmpieDataXML(String available, String used) throws FileNotFoundException, IOException
{
Element root = new Element(”pie”);
root.addContent(new Element(”slice”).setAttribute(”title”, “可用空间”).setText(available));
root.addContent(new Element(”slice”).setAttribute(”title”, “已用空间”).setText(used));
Document doc = new Document(root);
Format format = Format.getPrettyFormat();
XMLOutputter XMLOut = new XMLOutputter(format);
XMLOut.output(doc, new FileOutputStream(”/work/resin/webapps/auth-cgi/scripts/amchart/ampie/ampie_data.xml”));
}