Package com.iizigo.app
Class EclipseIFile
java.lang.Object
com.iizigo.app.EclipseIFile
- All Implemented Interfaces:
IIFile,IIResource
The Eclipse file wrapper.
- Author:
- Christopher Mindus
Constructor Summary
ConstructorsMethod Summary
Modifier and TypeMethodDescriptionbooleanCompares two resources.Get the Java canonical File.longGets the file size.Gets the full path to the resource.longGets the file modified time in milliseconds since the epoch.getName()Gets the name of the resource.inthashCode()The hash code.booleanChecks if this resource is a directory.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, waitMethods inherited from interface com.iizix.app.builder.IIResource
equals
Constructor Details
EclipseIFile
public EclipseIFile(org.eclipse.core.resources.IFile ifile) Constructs a file.
Method Details
getFullPath
Gets the full path to the resource.- Specified by:
getFullPathin interfaceIIResource- Throws:
IOException- For I/O errors.
getFile
Get the Java canonical File.- Specified by:
getFilein 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:
openInputStreamin 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:
isDirectoryin interfaceIIResource- Returns:
- false.
getName
Gets the name of the resource.- Specified by:
getNamein 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:
getFileSizein interfaceIIFile
getLastModified
public long getLastModified()Gets the file modified time in milliseconds since the epoch.- Specified by:
getLastModifiedin interfaceIIFile- Returns:
- Milliseconds since 1st January 1970, 0:00.