Class ResourceUtils

java.lang.Object
org.enterprisedomain.classmaker.util.ResourceUtils

public class ResourceUtils extends Object
  • Field Details

    • PROJECT_DELETE_MASK

      public static List<String> PROJECT_DELETE_MASK
    • WORKSPACE_RESOURCE_PATH

      public static final org.eclipse.core.runtime.IPath WORKSPACE_RESOURCE_PATH
  • Constructor Details

    • ResourceUtils

      public ResourceUtils()
  • Method Details

    • getModelTransformationPath

      public static org.eclipse.core.runtime.IPath getModelTransformationPath(org.eclipse.core.resources.IProject project, org.eclipse.emf.common.util.URI transformationURI)
    • getExportDestination

      public static org.eclipse.core.runtime.IPath getExportDestination(org.eclipse.core.resources.IProject project)
    • getTargetResourcePath

      public static org.eclipse.core.runtime.IPath getTargetResourcePath(org.eclipse.core.resources.IProject project, State state)
    • getEditTargetResourcePath

      public static org.eclipse.core.runtime.IPath getEditTargetResourcePath(org.eclipse.core.resources.IProject project, State state)
    • getEditorTargetResourcePath

      public static org.eclipse.core.runtime.IPath getEditorTargetResourcePath(org.eclipse.core.resources.IProject project, State state)
    • getModelFolderName

      public static String getModelFolderName()
      Returns the name of the folder within project, where the model resource is located.
      Returns:
    • getTargetFolderName

      public static String getTargetFolderName()
    • getModelFileExt

      public static String getModelFileExt()
    • getEcoreModelFileExt

      public static String getEcoreModelFileExt()
    • getFileName

      public static String getFileName(String name)
    • getEcoreFileName

      public static String getEcoreFileName(String name)
    • parseProjectName

      public static String parseProjectName(org.eclipse.emf.common.util.URI modelURI)
    • getWorkspaceLocation

      public static org.eclipse.core.runtime.IPath getWorkspaceLocation()
    • getProject

      public static org.eclipse.core.resources.IProject getProject(String projectName)
    • isProjectExists

      public static boolean isProjectExists(String projectName)
    • addElement

      public static String[] addElement(String[] elements, String element)
    • removeElement

      public static String[] removeElement(String[] elements, String element)
    • addProjectNature

      public static void addProjectNature(org.eclipse.core.resources.IProject project, String natureId) throws org.eclipse.core.runtime.CoreException
      Throws:
      org.eclipse.core.runtime.CoreException
    • removeProjectNature

      public static void removeProjectNature(org.eclipse.core.resources.IProject project, String natureId) throws org.eclipse.core.runtime.CoreException
      Throws:
      org.eclipse.core.runtime.CoreException
    • getBuildSpec

      public static org.eclipse.core.resources.ICommand getBuildSpec(org.eclipse.core.resources.IProjectDescription description, String builderId)
    • addToBuildSpec

      public static void addToBuildSpec(org.eclipse.core.resources.IProject project, String builderID) throws org.eclipse.core.runtime.CoreException
      Throws:
      org.eclipse.core.runtime.CoreException
    • removeFromBuildSpec

      public static void removeFromBuildSpec(org.eclipse.core.resources.IProject project, String builderID) throws org.eclipse.core.runtime.CoreException
      Throws:
      org.eclipse.core.runtime.CoreException
    • createProject

      public static void createProject(org.eclipse.core.resources.IProject project, String nature, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
      Throws:
      org.eclipse.core.runtime.CoreException
    • copyFile

      public static void copyFile(org.eclipse.emf.common.util.URI sourceURI, org.eclipse.core.runtime.IPath targetPath) throws org.eclipse.core.runtime.CoreException
      Throws:
      org.eclipse.core.runtime.CoreException
    • setAutoBuilding

      public static void setAutoBuilding(org.eclipse.core.resources.IWorkspace workspace, boolean value) throws org.eclipse.core.runtime.CoreException
      Throws:
      org.eclipse.core.runtime.CoreException
    • saveAutoBuilding

      public static void saveAutoBuilding(org.eclipse.core.resources.IWorkspace workspace)
    • restoreAutoBuilding

      public static void restoreAutoBuilding(org.eclipse.core.resources.IWorkspace workspace) throws org.eclipse.core.runtime.CoreException
      Throws:
      org.eclipse.core.runtime.CoreException
    • cleanupDir

      public static void cleanupDir(org.eclipse.core.resources.IProject project) throws org.eclipse.core.runtime.CoreException
      Throws:
      org.eclipse.core.runtime.CoreException
    • cleanupDir

      public static void cleanupDir(org.eclipse.core.resources.IProject project, String folderPath) throws org.eclipse.core.runtime.CoreException
      Throws:
      org.eclipse.core.runtime.CoreException
    • cleanupDir

      public static void cleanupDir(org.eclipse.core.resources.IProject project, String folderPath, String[] excluding) throws org.eclipse.core.runtime.CoreException
      Throws:
      org.eclipse.core.runtime.CoreException
    • delete

      public static void delete(File fileOrDir, String[] excluding)
    • writeFile

      public static void writeFile(org.eclipse.core.runtime.IPath location, CharSequence contents) throws org.eclipse.core.runtime.CoreException
      Throws:
      org.eclipse.core.runtime.CoreException