I've got a plugin that creates an xml file and I want that file saved to disk, but I can't seem to find the magic incantation to do so.
This is what I'm doing.
factory = PsiFileFactory.getInstance(project);
xmlFile = (XmlFile)factory.createFileFromText("foobar", XMLLanguage.INSTANCE, docToString(doc));
editorFactory = EditorFactory.getInstance();
psiDocumentManager = PsiDocumentManager.getInstance(project);
xmlEditor = editorFactory.createEditor(psiDocumentManager.getDocument(xmlFile));
The xml file opens in an editor tab, but no corresponding file is created on disk. Ideally I'd like this to be created in a resource directory of the currently open project.