public class JavaFileHandle extends org.eclipse.core.runtime.PlatformObject implements FileHandle
| Modifier and Type | Field and Description |
|---|---|
protected java.io.File |
file |
protected JavaProjectHandle |
projectHandle |
| Modifier | Constructor and Description |
|---|---|
protected |
JavaFileHandle(java.io.File projectFile) |
|
JavaFileHandle(JavaProjectHandle projectHandle,
java.io.File file) |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
createCanonicalFileName(java.io.File file) |
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.io.File |
getFile() |
java.lang.String |
getName()
Return a name that can access the physical storage with respect to its parent.
|
JavaFileHandle |
getParentFileHandle()
Return the handle of the parent of this handle.
|
ProjectHandle |
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.emf.common.util.URI |
getURI()
Get the URI of the file.
|
java.io.File |
isFile()
Return a non-null file object if this Handle applies to a file.
|
java.io.File |
isFolder()
Return a non-null folder object if this Handle applies to a folder or directory.
|
java.io.File |
isProject()
Return a non-null project object if this Handle applies to a project.
|
java.lang.String |
toString() |
protected final JavaProjectHandle projectHandle
protected final java.io.File file
protected JavaFileHandle(java.io.File projectFile)
throws java.io.IOException
java.io.IOExceptionpublic JavaFileHandle(JavaProjectHandle projectHandle, java.io.File file) throws java.io.IOException
java.io.IOExceptionpublic static java.lang.String createCanonicalFileName(java.io.File file)
throws java.io.IOException
java.io.IOExceptionpublic boolean exists()
FileHandleexists in interface FileHandlepublic java.lang.String getAbsoluteName()
FileHandlegetAbsoluteName in interface FileHandlepublic java.io.InputStream getContents()
throws java.io.FileNotFoundException
FileHandlegetContents in interface FileHandlejava.io.FileNotFoundException - if File access problempublic java.io.File getFile()
public java.lang.String getName()
FileHandlegetName in interface FileHandlepublic JavaFileHandle getParentFileHandle()
FileHandlegetParentFileHandle in interface FileHandlepublic ProjectHandle getProjectHandle()
FileHandlegetProjectHandle in interface FileHandlepublic java.lang.String getProjectRelativeName()
FileHandlegetProjectRelativeName in interface FileHandlepublic org.eclipse.core.runtime.IPath getProjectRelativePath()
public org.eclipse.emf.common.util.URI getURI()
FileHandlegetURI in interface FileHandlepublic java.io.File isFile()
FileHandleisFile in interface FileHandlepublic java.io.File isFolder()
FileHandleisFolder in interface FileHandlepublic java.io.File isProject()
FileHandleisProject in interface FileHandlepublic java.lang.String toString()
toString in class java.lang.Object