If I have handle to file how do I create a document and write to it? Right now, I am having to delete the file completely and recreate with new content as shown below :
IFile file = getFile();
file.delete();
file.create(input, false, null);
EDIT : This is in an eclipse plugin, not a regular java program.