Class WorkspaceRegistry

java.lang.Object
dev.equo.solstice.p2.WorkspaceRegistry

public class WorkspaceRegistry extends Object
Maintains a registry of EquoIDE workspaces.

So here's the problem. Let say you have a multiproject build, such as this:

 libA/
   .project
 libB/
   .project
 ide/
   build/oomph-ide/
     eclipse.exe
     workspace/
 
Everything works great! But in a single project build:
 lib/
   .project
   build/oomph-ide/
     eclipse.exe
     workspace/
 
It breaks. Why? Because the `workspace` is a subdirectory of the `.project` folder. And eclipse does not support that. GAH!

So, to fix that, we need to maintain the workspaces in a central registry. This class maintains that registry, and cleans out old workspaces when the IDE they were created for gets deleted.

The registry lives in CacheLocations.ideWorkspaces(). It names the workspace folders as such:

 gradle root project's name-hashcode of ide directory absolute path/
 gradle root project's name-hashcode of ide directory absolute path-owner   [file containing absolute path of ide folder]
 
  • Method Details

    • instance

      public static WorkspaceRegistry instance()
    • workspaceDirForProjectDir

      public File workspaceDirForProjectDir(File ideDir)
      Returns the workspace directory appropriate for the given name and file.
    • cleanWorkspaceDir

      public void cleanWorkspaceDir(File workspaceDir)
    • removeAbandoned

      public void removeAbandoned()
      Removes all workspace directories for which their owning workspace is no longer present.