public final void save() { // System.out.println("Content: save: Info=" + info.toString() + " Data=" + this.toString() + " // Data.Data=" + data.toString()); XmlWriter xml = new XmlWriter(); xml.openTag("content"); saveContent(xml); xml.openTag("info"); info.save(xml); xml.closeTag(); xml.closeTag(); try { IFolder folder = data.getFolder(); ResourceUtil.createFolderAndParents(folder); IFile file = folder.getFile("content.xml"); ByteArrayInputStream stream = new ByteArrayInputStream(xml.getXML().getBytes()); if (!file.exists()) file.create(stream, true, null); else file.setContents(stream, 0, null); } catch (Throwable t) { if (Log.error(this)) Log.error(this, "Unable to save data content", t); } }
public IFolder getFolder() throws CoreException { return data.getFolder(); }
public IFile getFile(String name) throws CoreException { return data.getFolder().getFile(new Path(name)); }
public IFolder getFolder(String name) throws CoreException { return data.getFolder().getFolder(name); }