Package com.iizigo.app
Class EclipseIPathFile
java.lang.Object
com.iizigo.app.EclipseIPathFile
- All Implemented Interfaces:
IIFile
,IIResource
The Eclipse file reference.
- Author:
- Christopher Mindus
Constructor Summary
ConstructorDescriptionEclipseIPathFile
(org.eclipse.core.runtime.IPath path, org.eclipse.core.filesystem.IFileStore fileStore) Constructs a file from a path.Method Summary
Modifier and TypeMethodDescriptionboolean
Compares two resources.Get the Java canonical File.long
Gets the file size.Gets the full path to the resource.long
Gets the file modified time in milliseconds since the epoch.getName()
Gets the name of the resource.int
hashCode()
The hash code.boolean
Checks if this resource is a directory.static IIResource
newResource
(org.eclipse.core.runtime.IPath path) Creates an EclipseIPathFile or EclipseIPathDirectory depending on the IPath.openInputStream
(Object monitor) Opens the input stream to the file.toString()
Resource String representation is the file name.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.iizix.app.builder.IIResource
equals
Constructor Details
EclipseIPathFile
public EclipseIPathFile(org.eclipse.core.runtime.IPath path, org.eclipse.core.filesystem.IFileStore fileStore) throws IOException Constructs a file from a path.- Parameters:
path
- The path.- Throws:
FileNotFoundException
- If file does not exist.IOException
- If it's a directory.
Method Details
newResource
Creates an EclipseIPathFile or EclipseIPathDirectory depending on the IPath.- Parameters:
path
- The path.- Throws:
IOException
- For I/O errors.
getFullPath
Gets the full path to the resource.- Specified by:
getFullPath
in interfaceIIResource
getFile
Get the Java canonical File.- Specified by:
getFile
in interfaceIIResource
- Parameters:
monitor
- The IProgressMonitor, null for none.- Returns:
- a File in canonical form.
- Throws:
IOException
- For I/O errors.
openInputStream
Opens the input stream to the file.- Specified by:
openInputStream
in interfaceIIFile
- Parameters:
monitor
- The IProgressMonitor, null for none.- Returns:
- The input stream.
- Throws:
IOException
- For read errors.
isDirectory
public boolean isDirectory()Checks if this resource is a directory.- Specified by:
isDirectory
in interfaceIIResource
- Returns:
- false.
getName
Gets the name of the resource.- Specified by:
getName
in interfaceIIResource
- Returns:
- The name of the resource (also includes the file extension).
equals
Compares two resources.hashCode
public int hashCode()The hash code.toString
Resource String representation is the file name.getFileSize
public long getFileSize()Gets the file size.- Specified by:
getFileSize
in interfaceIIFile
getLastModified
public long getLastModified()Gets the file modified time in milliseconds since the epoch.- Specified by:
getLastModified
in interfaceIIFile
- Returns:
- Milliseconds since 1st January 1970, 0:00.