Class EclipseIPathDirectory

java.lang.Object
com.iizigo.app.EclipseIPathDirectory
All Implemented Interfaces:
IIDirectory, IIResource

public class EclipseIPathDirectory extends Object implements IIDirectory
The Eclipse directory reference using an IPath.
Author:
Christopher Mindus
  • Constructor Details

    • EclipseIPathDirectory

      public EclipseIPathDirectory(IPath path, IFileStore fileStore) throws IOException
      Constructs a directory from a path.
      Parameters:
      path - The path.
      fileStore - The file store, null to get it from path.
      Throws:
      FileNotFoundException - If directory does not exist.
      IOException - If it's not a directory.
  • Method Details

    • getFullPath

      public String getFullPath()
      Gets the full path to the resource.
      Specified by:
      getFullPath in interface IIResource
    • getFile

      public File getFile(Object monitor) throws IOException
      Get the Java canonical File.
      Specified by:
      getFile in interface IIResource
      Parameters:
      monitor - The IProgressMonitor, null for none.
      Returns:
      a File in canonical form.
      Throws:
      IOException - For I/O errors.
    • listDirectory

      public List<IIResource> listDirectory(Object monitor) throws IOException
      Lists the contents of the directory.
      Specified by:
      listDirectory in interface IIDirectory
      Parameters:
      monitor - The IProgressMonitor, null for none.
      Throws:
      IOException - For directory errors.
    • isDirectory

      public boolean isDirectory()
      Checks if this resource is a directory.
      Specified by:
      isDirectory in interface IIResource
      Returns:
      true.
    • getName

      public String getName()
      Gets the name of the resource.
      Specified by:
      getName in interface IIResource
      Returns:
      The name of the resource (also includes the file extension).
    • equals

      public boolean equals(Object o)
      Compares two resources.
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      The hash code.
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Resource String representation is the file name.
      Overrides:
      toString in class Object