title: Eclipse RCP: How to programmatically create file/folder in workspace
body: <p>Project is developed for Eclipse Luna. I tried to programmatically create file/folder in workspace using code</p>
  
  <pre><code>try {
      fd.create(true, true, null);
  }
  catch (CoreException e) {
      e.printStackTrace();
  }
  </code></pre>
  
  <p>Here fd is an instance of IFolder. Code is triggered by a test button on a custom view. After clicking the button, I could see the new file/folder created in the directory tree displayed on the custom view. I checked the local file system and the newly created directory is there. The problem is if I re-run the project, the directory is not shown up in the directory tree.</p>
  
  <p>I tried to use this code before loading the directory tree to check the synchronization state:</p>
  
  <pre><code>ResourcesPlugin.getWorkspace().getRoot().isSynchronized(IResource.DEPTH_INFINITE)
  </code></pre>
  
  <p>And it always returned false. I tried to refresh local then</p>
  
  <pre><code>ResourcesPlugin.getWorkspace().getRoot().refreshLocal(IResource.DEPTH_INFINITE, null);
  </code></pre>
  
  <p>But that worked only for the current debugging/running process. That is, the next time I run the project, method isSynchronized(int) returns false again.</p>
  
  <p>Any suggestions about this problem? Thank you for your time and help.     </p>