Class PersistenceUtils


  • public class PersistenceUtils
    extends java.lang.Object
    Provides Eclipse-specific persistent utility methods. This class mostly delegates to PersistenceUtils.
    Author:
    Holger Eichelberger
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void closeProject​(org.eclipse.core.resources.IProject project)
      Closes a project, i.e., removes its configuration from the internal cache.
      static Configuration getConfiguration​(org.eclipse.core.resources.IProject project)
      Returns the (cached) configuration for the given project (in terms of a projectFolder).
      static org.eclipse.core.resources.IFolder getLocationFolder​(org.eclipse.core.resources.IProject project, Configuration.PathKind kind)
      Returns the specified location folder for the given project.
      static java.io.File getProjectLocation​(org.eclipse.core.resources.IProject project)
      Returns the location of the given project as a file.
      static org.eclipse.core.runtime.IPath makeWsPathAbsolute​(org.eclipse.core.runtime.IPath path)
      Turns a workspace-relative path into an absolute path.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PersistenceUtils

        public PersistenceUtils()
    • Method Detail

      • getProjectLocation

        public static final java.io.File getProjectLocation​(org.eclipse.core.resources.IProject project)
        Returns the location of the given project as a file.
        Parameters:
        project - the project to return the folder for
        Returns:
        the project location
      • getLocationFolder

        public static final org.eclipse.core.resources.IFolder getLocationFolder​(org.eclipse.core.resources.IProject project,
                                                                                 Configuration.PathKind kind)
        Returns the specified location folder for the given project. This is a convenience method for Configuration#getPath(PathKind).
        Parameters:
        project - the project to return the folder for
        kind - the path kind
        Returns:
        the folder; note that the existence of this folder is not guaranteed
      • getConfiguration

        public static final Configuration getConfiguration​(org.eclipse.core.resources.IProject project)
        Returns the (cached) configuration for the given project (in terms of a projectFolder).
        Parameters:
        project - the project to return the folder for
        Returns:
        the configuration of the project
      • closeProject

        public static final void closeProject​(org.eclipse.core.resources.IProject project)
        Closes a project, i.e., removes its configuration from the internal cache.
        Parameters:
        project - the project to return the folder for
      • makeWsPathAbsolute

        public static final org.eclipse.core.runtime.IPath makeWsPathAbsolute​(org.eclipse.core.runtime.IPath path)
        Turns a workspace-relative path into an absolute path.
        Parameters:
        path - the workspace-relative path
        Returns:
        the absolute path (path if it is not located in the workspace)