Class EclipseIPathDirectory

  • All Implemented Interfaces:
    IIDirectory, IIResource

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

      Constructors 
      ConstructorDescription
      EclipseIPathDirectory​(org.eclipse.core.runtime.IPath path, org.eclipse.core.filesystem.IFileStore fileStore)
      Constructs a directory from a path.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      booleanequals​(java.lang.Object o)
      Compares two resources.
      java.io.FilegetFile​(java.lang.Object monitor)
      Get the Java canonical File.
      java.lang.StringgetFullPath()
      Gets the full path to the resource.
      java.lang.StringgetName()
      Gets the name of the resource.
      inthashCode()
      The hash code.
      booleanisDirectory()
      Checks if this resource is a directory.
      java.util.List<IIResource>listDirectory​(java.lang.Object monitor)
      Lists the contents of the directory.
      java.lang.StringtoString()
      Resource String representation is the file name.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • EclipseIPathDirectory

        public EclipseIPathDirectory​(org.eclipse.core.runtime.IPath path,
                                     org.eclipse.core.filesystem.IFileStore fileStore)
                              throws java.io.IOException
        Constructs a directory from a path.
        Parameters:
        path - The path.
        fileStore - The file store, null to get it from path.
        Throws:
        java.io.FileNotFoundException - If directory does not exist.
        java.io.IOException - If it's not a directory.
    • Method Detail

      • getFullPath

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

        public java.io.File getFile​(java.lang.Object monitor)
                             throws java.io.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:
        java.io.IOException - For I/O errors.
      • listDirectory

        public java.util.List<IIResource> listDirectory​(java.lang.Object monitor)
                                                 throws java.io.IOException
        Lists the contents of the directory.
        Specified by:
        listDirectory in interface IIDirectory
        Parameters:
        monitor - The IProgressMonitor, null for none.
        Throws:
        java.io.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 java.lang.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​(java.lang.Object o)
        Compares two resources.
        Overrides:
        equals in class java.lang.Object
      • hashCode

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

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