title: Programmatically list open projects in an eclipse workspace from outside of eclipse
body: <p>I want to write a Gradle plugin which can inspect an eclipse workspace directory and iterate over the open projects within the workspace and determine the location of each.</p>
  
  <p>Something like</p>
  
  <pre><code>Workspace workspace = EclipseUtils.parseWorkspace("c:/myEclipseWorkspace");
  Collection&lt;Project&gt; projects = workspace.getProjects();
  for (Project project : projects) {
     System.out.println(String.format("name=%s, location=%s, open=%s",
        project.getName(), project.getLocation(), project.isOpen()));
  }
  </code></pre>
  
  <p>I've looked at my workspace and can see some <code>.location</code> files under <code>c:\myEclipseWorkspace\.metadata\.plugins\org.eclipse.core.resources\.projects\</code></p>
  
  <p>But these files are a custom binary format
      <a href="https://i.stack.imgur.com/unAqX.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/unAqX.jpg" alt="enter image description here"></a></p>
  
  <p>Is there an eclipse API that I can invoke to parse these? Or some other solution to iterate the open projects in a workspace.</p>
  
  <p>Please note that I want to do this externally to eclipse and NOT within an eclipse plugin.</p>