Cannot write content to file
Hi!
I'm trying to write generated data to the file, but the context of the file stays untouched. My code:
VirtualFile manifestFile = resources.createChildData(resources, "manifest.xml");
System.out.println("Writing manifest to " + manifestFile.getCanonicalPath());
xstream.toXML(new Envelope(manifest), manifestFile.getOutputStream(ApplicationManager.getApplication()));
Look like wrong requestor parameter. How can I fix it?
Please sign in to leave a comment.
Solved with `setBinaryContent`. But I still don't understand why `getOutputStream` doesn't work
Most likely you forgot to close the stream after writing to it.
And what about `requestor` parameter? How can I get one?
It doesn't matter for your purposes. Any non-null object would be fine.