public class FileSystemDirectory extends Directory
Constructor and Description |
---|
FileSystemDirectory(java.io.File javaFile) |
FileSystemDirectory(java.lang.String directoryPath) |
Modifier and Type | Method and Description |
---|---|
void |
create()
Create the directory, if it doesn't already exist.
|
void |
delete()
Delete this directory.
|
boolean |
exists()
See if the directory exists.
|
Directory |
getDirectory(java.lang.String name)
Get the child directory, which may or may not already exist.
|
File |
getFile(java.lang.String name)
Get a file under the directory, which may or may not already exist.
|
java.io.File |
getJavaFile() |
long |
getLastModifiedTime() |
java.lang.String |
getName()
Get the name of this file/directory--the last component of the path.
|
java.lang.String |
getPathString()
Get the string representation of the full path for this file/directory.
|
boolean |
isSetLastModifiedTimeSupported() |
void |
renameTo(java.lang.String newName)
Rename this directory, giving it a new name in the same parent directory.
|
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,
VisitFailed visitFailed)
Visit the child elements of this path--basically list the files and subdirectories of a directory, calling the
visitor for each.
|
createDirectory, deleteContents, isEmpty, visitChildren
getNameExtension, toString
public FileSystemDirectory(java.lang.String directoryPath)
public FileSystemDirectory(java.io.File javaFile)
public java.lang.String getName()
Path
public java.lang.String getPathString()
Path
getPathString
in class Path
public File getFile(java.lang.String name)
Directory
public Directory getDirectory(java.lang.String name)
Directory
getDirectory
in class Directory
name
- directory namepublic boolean exists()
Directory
public void create()
Directory
public void renameTo(java.lang.String newName)
Directory
public void visitChildren(@Nullable FileVisitor fileVisitor, @Nullable DirectoryVisitor directoryVisitor, @Nullable VisitFailed visitFailed)
visitChildren
in class Directory
public void delete()
Directory
public long getLastModifiedTime()
getLastModifiedTime
in class Directory
public void setLastModifiedTime(long time)
Directory
setLastModifiedTime
in class Directory
public boolean isSetLastModifiedTimeSupported()
isSetLastModifiedTimeSupported
in class Directory
public java.io.File getJavaFile()