Class JavaDirectory

java.lang.Object
com.iizix.app.builder.JavaDirectory
All Implemented Interfaces:
IIDirectory, IIResource

public class JavaDirectory extends Object implements IIDirectory
The Java directory wrapper.
Author:
Christopher Mindus
  • Constructor Details

    • JavaDirectory

      public JavaDirectory(File dir) throws IOException
      Constructs a directory.
      Parameters:
      dir - The directory.
      Throws:
      IOException - For I/O errors or if file is 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)
      Get the Java canonical File.
      Specified by:
      getFile in interface IIResource
      Parameters:
      monitor - The IProgressMonitor, null for none.
      Returns:
      a File in canonical form.
    • 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:
      FileNotFoundException - If directory doesn't exist.
      IOException - For I/O 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