Package com.iizigo.app
Class EclipseIPathFile
- java.lang.Object
- com.iizigo.app.EclipseIPathFile
 
- All Implemented Interfaces:
- IIFile,- IIResource
 - public class EclipseIPathFile extends java.lang.Object implements IIFile The Eclipse file reference.- Author:
- Christopher Mindus
 
- Constructor Summary- Constructors - Constructor - Description - EclipseIPathFile(org.eclipse.core.runtime.IPath path, org.eclipse.core.filesystem.IFileStore fileStore)Constructs a file from a path.
 - Method Summary- All Methods Static Methods Instance Methods Concrete Methods - Modifier and Type - Method - Description - boolean- equals(java.lang.Object o)Compares two resources.- java.io.File- getFile(java.lang.Object monitor)Get the Java canonical File.- long- getFileSize()Gets the file size.- java.lang.String- getFullPath()Gets the full path to the resource.- long- getLastModified()Gets the file modified time in milliseconds since the epoch.- java.lang.String- getName()Gets the name of the resource.- int- hashCode()The hash code.- boolean- isDirectory()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.- java.io.InputStream- openInputStream(java.lang.Object monitor)Opens the input stream to the file.- java.lang.String- 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 Detail- EclipseIPathFile- public EclipseIPathFile(org.eclipse.core.runtime.IPath path, org.eclipse.core.filesystem.IFileStore fileStore) throws java.io.IOExceptionConstructs a file from a path.- Parameters:
- path- The path.
- Throws:
- java.io.FileNotFoundException- If file does not exist.
- java.io.IOException- If it's a directory.
 
 
 - Method Detail- newResource- public static IIResource newResource(org.eclipse.core.runtime.IPath path) throws java.io.IOException Creates an EclipseIPathFile or EclipseIPathDirectory depending on the IPath.- Parameters:
- path- The path.
- Throws:
- java.io.IOException- For I/O errors.
 
 - getFullPath- public java.lang.String getFullPath() Gets the full path to the resource.- Specified by:
- getFullPathin interface- IIResource
 
 - getFile- public java.io.File getFile(java.lang.Object monitor) throws java.io.IOExceptionGet the Java canonical File.- Specified by:
- getFilein interface- IIResource
- Parameters:
- monitor- The IProgressMonitor, null for none.
- Returns:
- a File in canonical form.
- Throws:
- java.io.IOException- For I/O errors.
 
 - openInputStream- public java.io.InputStream openInputStream(java.lang.Object monitor) throws java.io.IOExceptionOpens the input stream to the file.- Specified by:
- openInputStreamin interface- IIFile
- Parameters:
- monitor- The IProgressMonitor, null for none.
- Returns:
- The input stream.
- Throws:
- java.io.IOException- For read errors.
 
 - isDirectory- public boolean isDirectory() Checks if this resource is a directory.- Specified by:
- isDirectoryin interface- IIResource
- Returns:
- false.
 
 - getName- public java.lang.String getName() Gets the name of the resource.- Specified by:
- getNamein interface- IIResource
- Returns:
- The name of the resource (also includes the file extension).
 
 - equals- public boolean equals(java.lang.Object o) Compares two resources.- Overrides:
- equalsin class- java.lang.Object
 
 - hashCode- public int hashCode() The hash code.- Overrides:
- hashCodein class- java.lang.Object
 
 - toString- public java.lang.String toString() Resource String representation is the file name.- Overrides:
- toStringin class- java.lang.Object
 
 - getFileSize- public long getFileSize() Gets the file size.- Specified by:
- getFileSizein interface- IIFile
 
 - getLastModified- public long getLastModified() Gets the file modified time in milliseconds since the epoch.- Specified by:
- getLastModifiedin interface- IIFile
- Returns:
- Milliseconds since 1st January 1970, 0:00.