public abstract class Directory extends Path
Constructor and Description |
---|
Directory() |
Modifier and Type | Method and Description |
---|---|
abstract void |
create()
Create the directory, if it doesn't already exist.
|
Directory |
createDirectory(java.lang.String name)
Get the child directory, creating it if it doesn't already exist.
|
abstract void |
delete()
Delete this directory.
|
void |
deleteContents()
Delete the contents of this directory, recursi vely.
|
abstract boolean |
exists()
See if the directory exists.
|
abstract Directory |
getDirectory(java.lang.String name)
Get the child directory, which may or may not already exist.
|
abstract File |
getFile(java.lang.String name)
Get a file under the directory, which may or may not already exist.
|
abstract long |
getLastModifiedTime() |
boolean |
isEmpty()
Check if this directory has any contents.
|
abstract boolean |
isSetLastModifiedTimeSupported() |
abstract void |
renameTo(java.lang.String newName)
Rename this directory, giving it a new name in the same parent directory.
|
abstract void |
setLastModifiedTime(long time)
Set the last modified time for the directory, if supported by the platform (that is, if
isSetLastModifiedTimeSupported() returns true).
|
void |
visitChildren(FileVisitor fileVisitor,
DirectoryVisitor directoryVisitor)
Visit the child elements of this path--basically list the files and subdirectories of a directory, calling the
visitor for each.
|
abstract void |
visitChildren(FileVisitor fileVisitor,
DirectoryVisitor directoryVisitor,
VisitFailed visitFailed)
Visit the child elements of this path--basically list the files and subdirectories of a directory, calling the
visitor for each.
|
getName, getNameExtension, getPathString, toString
public abstract File getFile(java.lang.String name)
name
- file namepublic abstract Directory getDirectory(java.lang.String name)
name
- directory namepublic Directory createDirectory(java.lang.String name)
name
- directory namepublic abstract boolean exists()
public abstract void create()
public abstract void renameTo(java.lang.String newName)
newName
- public abstract void visitChildren(@Nullable FileVisitor fileVisitor, @Nullable DirectoryVisitor directoryVisitor, @Nullable VisitFailed visitFailed)
public void visitChildren(@Nullable FileVisitor fileVisitor, @Nullable DirectoryVisitor directoryVisitor)
public abstract void delete()
public abstract long getLastModifiedTime()
public abstract void setLastModifiedTime(long time)
time
- public abstract boolean isSetLastModifiedTimeSupported()
public void deleteContents()
public boolean isEmpty()