java.lang.Object
net.ssehub.easy.producer.eclipse.persistency.eclipse.PersistenceUtils

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

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static final void
    closeProject(org.eclipse.core.resources.IProject project)
    Closes a project, i.e., removes its configuration from the internal cache.
    static final net.ssehub.easy.producer.core.persistence.Configuration
    getConfiguration(org.eclipse.core.resources.IProject project)
    Returns the (cached) configuration for the given project (in terms of a projectFolder).
    static final org.eclipse.core.resources.IFolder
    getLocationFolder(org.eclipse.core.resources.IProject project, net.ssehub.easy.producer.core.persistence.Configuration.PathKind kind)
    Returns the specified location folder for the given project.
    static final File
    getProjectLocation(org.eclipse.core.resources.IProject project)
    Returns the location of the given project as a file.
    static final 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 Details

    • PersistenceUtils

      public PersistenceUtils()
  • Method Details

    • getProjectLocation

      public static final 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, net.ssehub.easy.producer.core.persistence.Configuration.PathKind kind)
      Returns the specified location folder for the given project. This is a convenience method for Configuration.getPath(PathKind, int).
      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 net.ssehub.easy.producer.core.persistence.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)