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.IOException
public JavaFileHandle(JavaProjectHandle projectHandle, java.io.File file) throws java.io.IOException
java.io.IOException
public static java.lang.String createCanonicalFileName(java.io.File file) throws java.io.IOException
java.io.IOException
public boolean exists()
FileHandle
exists
in interface FileHandle
public java.lang.String getAbsoluteName()
FileHandle
getAbsoluteName
in interface FileHandle
public java.io.InputStream getContents() throws java.io.FileNotFoundException
FileHandle
getContents
in interface FileHandle
java.io.FileNotFoundException
- if File access problempublic java.io.File getFile()
public java.lang.String getName()
FileHandle
getName
in interface FileHandle
public JavaFileHandle getParentFileHandle()
FileHandle
getParentFileHandle
in interface FileHandle
public ProjectHandle getProjectHandle()
FileHandle
getProjectHandle
in interface FileHandle
public java.lang.String getProjectRelativeName()
FileHandle
getProjectRelativeName
in interface FileHandle
public org.eclipse.core.runtime.IPath getProjectRelativePath()
public org.eclipse.emf.common.util.URI getURI()
FileHandle
getURI
in interface FileHandle
public java.io.File isFile()
FileHandle
isFile
in interface FileHandle
public java.io.File isFolder()
FileHandle
isFolder
in interface FileHandle
public java.io.File isProject()
FileHandle
isProject
in interface FileHandle
public java.lang.String toString()
toString
in class java.lang.Object