org.eclipse.gmt.umlx.registry.eclipse
Class EclipseFileHandle

java.lang.Object
  extended by org.eclipse.core.runtime.PlatformObject
      extended by org.eclipse.gmt.umlx.registry.eclipse.EclipseFileHandle
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, AbstractFileHandle
Direct Known Subclasses:
EclipseProjectHandle

public class EclipseFileHandle
extends org.eclipse.core.runtime.PlatformObject
implements AbstractFileHandle


Constructor Summary
EclipseFileHandle(EclipseProjectHandle projectHandle, org.eclipse.core.resources.IResource resource)
           
 
Method Summary
 boolean exists()
          Return true if file exists.
 java.lang.String getAbsoluteName()
          Return a name that can access the physical storage without reference to any other context.
 java.io.InputStream getContents()
          Return a stream from which the contents can be read.
 java.lang.String getName()
          Return a name that can access the physical storage with respect to its parent.
 EclipseFileHandle getParentFileHandle()
          Return the handle of the parent of this handle.
 AbstractProjectHandle getProjectHandle()
          Return the handle of the project.
 java.lang.String getProjectRelativeName()
          Return a name that can access the physical storage with respect to the project.
 org.eclipse.core.runtime.IPath getProjectRelativePath()
           
 org.eclipse.core.resources.IResource getResource()
           
 org.eclipse.emf.common.util.URI getURI()
          Get the URI of the file.
 org.eclipse.core.resources.IFile isFile()
          Return a non-null file object if this Handle applies to a file.
 org.eclipse.core.resources.IFolder isFolder()
          Return a non-null folder object if this Handle applies to a folder or directory.
 org.eclipse.core.resources.IProject isProject()
          Return a non-null project object if this Handle applies to a project.
 java.lang.String toString()
           
 
Methods inherited from class org.eclipse.core.runtime.PlatformObject
getAdapter
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Constructor Detail

EclipseFileHandle

public EclipseFileHandle(EclipseProjectHandle projectHandle,
                         org.eclipse.core.resources.IResource resource)
Method Detail

exists

public boolean exists()
Description copied from interface: AbstractFileHandle
Return true if file exists.

Specified by:
exists in interface AbstractFileHandle
Returns:
true if exists.

getAbsoluteName

public java.lang.String getAbsoluteName()
Description copied from interface: AbstractFileHandle
Return a name that can access the physical storage without reference to any other context.

Specified by:
getAbsoluteName in interface AbstractFileHandle
Returns:
the absolute name.

getContents

public java.io.InputStream getContents()
                                throws org.eclipse.core.runtime.CoreException
Description copied from interface: AbstractFileHandle
Return a stream from which the contents can be read.

Specified by:
getContents in interface AbstractFileHandle
Returns:
the stream
Throws:
org.eclipse.core.runtime.CoreException - if Eclipse resource access problem

getName

public java.lang.String getName()
Description copied from interface: AbstractFileHandle
Return a name that can access the physical storage with respect to its parent. e.g the file name and extension without any devuice or directories.

Specified by:
getName in interface AbstractFileHandle
Returns:
the name.

getParentFileHandle

public EclipseFileHandle getParentFileHandle()
Description copied from interface: AbstractFileHandle
Return the handle of the parent of this handle.

Specified by:
getParentFileHandle in interface AbstractFileHandle
Returns:
the parent handle, null for the parent of the project.

getProjectHandle

public AbstractProjectHandle getProjectHandle()
Description copied from interface: AbstractFileHandle
Return the handle of the project.

Specified by:
getProjectHandle in interface AbstractFileHandle
Returns:
the project handle.

getProjectRelativeName

public java.lang.String getProjectRelativeName()
Description copied from interface: AbstractFileHandle
Return a name that can access the physical storage with respect to the project.

Specified by:
getProjectRelativeName in interface AbstractFileHandle
Returns:
the project relative name.

getProjectRelativePath

public org.eclipse.core.runtime.IPath getProjectRelativePath()

getResource

public org.eclipse.core.resources.IResource getResource()

getURI

public org.eclipse.emf.common.util.URI getURI()
Description copied from interface: AbstractFileHandle
Get the URI of the file.

Specified by:
getURI in interface AbstractFileHandle
Returns:
the file URI

isFile

public org.eclipse.core.resources.IFile isFile()
Description copied from interface: AbstractFileHandle
Return a non-null file object if this Handle applies to a file.

Specified by:
isFile in interface AbstractFileHandle
Returns:
non-null file object.

isFolder

public org.eclipse.core.resources.IFolder isFolder()
Description copied from interface: AbstractFileHandle
Return a non-null folder object if this Handle applies to a folder or directory.

Specified by:
isFolder in interface AbstractFileHandle
Returns:
non-null folder object.

isProject

public org.eclipse.core.resources.IProject isProject()
Description copied from interface: AbstractFileHandle
Return a non-null project object if this Handle applies to a project.

Specified by:
isProject in interface AbstractFileHandle
Returns:
non-null project object.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object