title: How do I write to a file in eclipse?
body: <p>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 :</p>
  
  <pre><code>IFile file = getFile(); 
  file.delete();
  file.create(input, false, null);
  </code></pre>
  
  <p><strong>EDIT</strong> : This is in an eclipse plugin, not a regular java program.</p>