Package de.elo.ix.jscript
Class DiscDir
java.lang.Object
de.elo.ix.jscript.DiscDir
This class provides functions for creating and deleting directories.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
exists()
Returns true, if the file exists.getDir()
Get the directory as a java.io.File object.DiscDir[]
getDirs()
Returns all subdirectories.DiscFile[]
getFiles()
Returns all files without subdirectoriesgetName()
Get the absolute path of the directory.boolean
mkdirs()
Create the full path inclusive this directory.boolean
purge()
Deletes this directory even it is not empty.boolean
remove()
Delete this directory.void
Get the directory as a java.io.File object.void
Set the absolute path of the directory.
-
Constructor Details
-
DiscDir
Constructor.- Parameters:
dirName
- Directory name
-
DiscDir
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
Returns all subdirectories.- Returns:
- subdirectories
-
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
Get the absolute path of the directory.- Returns:
- Absolute path as string.
-
setName
Set the absolute path of the directory.- Parameters:
dirName
- Absolute path as string.
-
getDir
Get the directory as a java.io.File object.- Returns:
- File object
-
setDir
Get the directory as a java.io.File object.
-