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?

4 comments

Solved with `setBinaryContent`. But I still don't understand why `getOutputStream` doesn't work

0

Most likely you forgot to close the stream after writing to it.

0

And what about `requestor` parameter? How can I get one?

0

It doesn't matter for your purposes. Any non-null object would be fine.

0

Please sign in to leave a comment.