|
TPTP 4.5.0 Platform Project Public API Specification |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eclipse.hyades.models.common.util.ResourceUtil
public class ResourceUtil
Contains utility methods to manipulate the Eclipse resources.
| Nested Class Summary | |
|---|---|
static interface |
ResourceUtil.IGetFilesVisitor
Interface to define a visitor for the getFile(...) |
| Field Summary | |
|---|---|
static java.util.Map |
RESOURCE_OPTIONS
|
| Constructor Summary | |
|---|---|
ResourceUtil()
|
|
| Method Summary | |
|---|---|
static void |
createContainer(org.eclipse.core.resources.IContainer container,
org.eclipse.core.runtime.IProgressMonitor progressMonitor)
Creates the given container and it's parent if necessary. |
static java.util.Map |
getFiles(org.eclipse.core.resources.IResource resource,
java.lang.String[] fileExtensions,
ResourceUtil.IGetFilesVisitor visitor)
Returns a map with all the "files" that are "related" to a given resource and that have their file extension listed in the file extensions array. |
static java.util.Map |
getFiles(org.eclipse.core.resources.IWorkspaceRoot workspaceRoot,
java.lang.String[] fileExtensions,
ResourceUtil.IGetFilesVisitor visitor)
Returns a map with all the "files" from all the projects in a given workspace root that have their file extension listed in the file extensions array. |
static java.io.File |
getPluginDirectory(java.lang.String pluginId)
Returns a File handle to the directory of a plugin or
null if the directory was not found. |
static org.eclipse.emf.ecore.resource.Resource.Factory |
getResourceFactory(java.lang.String fileExtension)
Returns the resource factory associated with a given file extension. |
static org.eclipse.emf.ecore.EObject[] |
load(org.eclipse.emf.ecore.resource.ResourceSet resourceSet,
org.eclipse.core.resources.IFile file)
Loads the specified file returning all the root EObjects. |
static org.eclipse.emf.ecore.EObject[] |
load(org.eclipse.emf.ecore.resource.ResourceSet resourceSet,
java.lang.String fullPath)
Loads the specified file returning all the root EObjects. |
static void |
logError(java.lang.Throwable e)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.util.Map RESOURCE_OPTIONS
| Constructor Detail |
|---|
public ResourceUtil()
| Method Detail |
|---|
public static void createContainer(org.eclipse.core.resources.IContainer container,
org.eclipse.core.runtime.IProgressMonitor progressMonitor)
throws org.eclipse.core.runtime.CoreException
container - progressMonitor -
org.eclipse.core.runtime.CoreException
public static java.util.Map getFiles(org.eclipse.core.resources.IWorkspaceRoot workspaceRoot,
java.lang.String[] fileExtensions,
ResourceUtil.IGetFilesVisitor visitor)
This method looks for files recursively if the resource is a project or a folder.
In order to be added to the map the file must exists and must belong to an open project.
Clients can specify a visitor to be used by this method. The visitor
is able to defined the object that added to the map - that's the reason
the word file is between quotes in the paragraphs above. If the visitor
is null then the file is added to the map
workspaceRoot - fileExtensions. - visitor -
List of instances of
IFile or with the values defined by the
visitor for each file extension.
public static java.util.Map getFiles(org.eclipse.core.resources.IResource resource,
java.lang.String[] fileExtensions,
ResourceUtil.IGetFilesVisitor visitor)
This method looks for files recursively if the resource is a project or a folder.
In order to be added to the map the file must exists and must belong to an open project.
Clients can specify a visitor to be used by this method. The visitor
is able to defined the object that added to the map - that's the reason
the word file is between quotes in the paragraphs above. If the visitor
is null then the file is added to the map
resource - fileExtensions. -
List of instances of
IFile or with the values defined by the
visitor for each file extension.
public static org.eclipse.emf.ecore.EObject[] load(org.eclipse.emf.ecore.resource.ResourceSet resourceSet,
org.eclipse.core.resources.IFile file)
null then this method tries
to find a registered resource factory.
If the load attempt fails this method adds an entry to the log and returns an empty array.
resourceSet - file -
public static org.eclipse.emf.ecore.EObject[] load(org.eclipse.emf.ecore.resource.ResourceSet resourceSet,
java.lang.String fullPath)
null then this method tries
to find a registered resource factory.
If the load attempt fails this method adds an entry to the log and returns an empty array.
resourceSet - fullPath -
public static org.eclipse.emf.ecore.resource.Resource.Factory getResourceFactory(java.lang.String fileExtension)
null or if there isn't a specifc
factory for the file extension, the this method returns the generic
factory.
fileExtension -
null if none.public static final void logError(java.lang.Throwable e)
e - public static java.io.File getPluginDirectory(java.lang.String pluginId)
File handle to the directory of a plugin or
null if the directory was not found.
pluginId -
|
TPTP 4.5.0 Platform Project Public API Specification |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||