org.eclipse.stp.core.infrastructure.emf
Interface IResourceDescriptor

All Known Implementing Classes:
EclipseResourceDescriptor

public interface IResourceDescriptor

The ResourceDescriptor describes a specific resource or the rules for locating a particular kind of Resource. The goal of this object is to reduce our dependency on specific locations in a "context" (read: "project" or "component").

Clients can choose how to create ResourceDescriptors, and the structure of this object will evolve as new ways to identify Resources are found or invented. The initially proposed approach is to specify a "standardURI" (where the Resource 'should' be) and a "localPath" (where the Resource actually exists. Thus, clients should first check the localPath and then fall back on the standardURI. (The types of these fields might need to be consolidated).

The ResourceDescriptor will define an algorithm for how the information available in this object should be used to identify specific Resources in a collection of Resources.

See Also:
IScribblerDomain

Method Summary
 IPath getDefaultPath()
          Return the default relative location where this resource could be found.
 IPath getLocalPath()
          Return the workspace relative location where the resource was found.
 java.lang.String getRequestProtocol()
           
 boolean isLoadAsReadOnly()
           
 boolean matches(IFile file)
          A ResourceDescriptor might be able to indicate what it matches.
 

Method Detail

isLoadAsReadOnly

boolean isLoadAsReadOnly()

getRequestProtocol

java.lang.String getRequestProtocol()
Returns:
The protocol to use when requesting a resource (e.g. "platform:/resource" or "comptype:"). Do not supply a trailing slash.

getLocalPath

IPath getLocalPath()
Return the workspace relative location where the resource was found.

Returns:

getDefaultPath

IPath getDefaultPath()
Return the default relative location where this resource could be found. This method may be used when creating a new resource. Example: "META-INF/ejb-jar.xml"

Returns:

matches

boolean matches(IFile file)
A ResourceDescriptor might be able to indicate what it matches.

Parameters:
file -
Returns: