Class DiscDir

java.lang.Object
de.elo.ix.jscript.DiscDir

public class DiscDir extends Object
This class provides functions for creating and deleting directories.
  • Constructor Details

    • DiscDir

      public DiscDir(String dirName)
      Constructor.
      Parameters:
      dirName - Directory name
    • DiscDir

      public DiscDir(File dir)
      Constructor.
      Parameters:
      dir - Directory as File object
  • Method Details

    • exists

      public boolean exists()
      Returns true, if the file exists.
      Returns:
      true, if the file exists
    • mkdirs

      public boolean mkdirs()
      Create the full path inclusive this directory.
      Returns:
      true on success.
    • remove

      public boolean remove()
      Delete this directory. If the directory is not empty or is not accessible, the function returns false. If the directory does not exist, the return value is true.
      Returns:
      true on success.
      See Also:
    • getDirs

      public DiscDir[] getDirs()
      Returns all subdirectories.
      Returns:
      subdirectories
    • getFiles

      public DiscFile[] getFiles()
      Returns all files without subdirectories
      Returns:
      Array of files
    • purge

      public boolean purge()
      Deletes this directory even it is not empty.
      Returns:
      true, if the directory was deleted.
      See Also:
    • getName

      public String getName()
      Get the absolute path of the directory.
      Returns:
      Absolute path as string.
    • setName

      public void setName(String dirName)
      Set the absolute path of the directory.
      Parameters:
      dirName - Absolute path as string.
    • getDir

      public File getDir()
      Get the directory as a java.io.File object.
      Returns:
      File object
    • setDir

      public void setDir(File dir)
      Get the directory as a java.io.File object.