|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.cotta.TEntry
net.sf.cotta.TDirectory
public class TDirectory
The class that represent the directory. To create TDirectory, use TFile, TDirectory, and TFileFactory
TFileFactory.physicalDir(java.io.File),
TFileFactory.dir(String),
TFileFactory.dir(TPath),
TEntry.parent(),
TEntry.parent(),
dir(String),
dir(TPath)| Field Summary |
|---|
| Fields inherited from class net.sf.cotta.TEntry |
|---|
path |
| Constructor Summary | |
|---|---|
TDirectory(FileSystem fileSystem,
TPath path)
Deprecated. Use the other constructor for default encoding support in TFileFactory |
|
TDirectory(TFileFactory factory,
TPath path)
|
|
| Method Summary | |
|---|---|
void |
delete()
Delete the current directory. |
void |
deleteAll()
Delete the whole directory tree |
TDirectory |
dir(java.lang.String relativePath)
Constructs a subdirectory given the directory name |
TDirectory |
dir(TPath path)
Constructs a directory given the relative path to the current directory |
TDirectory |
ensureExists()
|
boolean |
exists()
|
TFile |
file(java.lang.String path)
Constucts a file given the path. |
TFile |
file(TPath path)
Constructs a file given the relative path. |
java.io.File |
getJavaFile()
Deprecated. use #toJavaFile() |
TDirectoryListing |
list()
List the current directory |
TDirectoryListing |
list(TDirectoryFilter filter)
List the current directory with directory filter |
TDirectoryListing |
list(TDirectoryFilter directoryFilter,
TFileFilter fileFilter)
List the current directory with file filter and directory filter |
TDirectoryListing |
list(TEntryFilter filter)
List the current directory with entry filter |
TDirectoryListing |
list(TFileFilter filter)
List the current directory with file filter |
TDirectory[] |
listDirs()
Deprecated. use list().dirs() |
TDirectory[] |
listDirs(TDirectoryFilter directoryFilter)
Deprecated. use list(directoryFilter).dirs() |
TFile[] |
listFiles()
Deprecated. |
TFile[] |
listFiles(TFileFilter fileFilter)
Deprecated. use list(fileFilter).files() |
void |
mergeTo(TDirectory target)
|
void |
moveTo(TDirectory target)
|
TDirectory |
toCanonicalDir()
|
void |
visit(FileVisitor fileVisitor)
|
void |
zipTo(TFile file)
Zip the current directory to a file, with the files and directories of current directory at the root level |
| Methods inherited from class net.sf.cotta.TEntry |
|---|
compareTo, equals, factory, filesystem, hashCode, isChildOf, name, parent, path, pathFrom, toCanonicalPath, toJavaFile, toPath, toPathString, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public TDirectory(FileSystem fileSystem,
TPath path)
fileSystem - The file system that backs the filepath - The path to the fileTDirectory(TFileFactory, TPath)
public TDirectory(TFileFactory factory,
TPath path)
| Method Detail |
|---|
public boolean exists()
exists in class TEntry
public TDirectory ensureExists()
throws TIoException
TIoExceptionpublic TFile file(java.lang.String path)
path - the path of the file
file(TPath)public TFile file(TPath path)
path - path to the file
public TDirectory dir(java.lang.String relativePath)
relativePath - the relative path of the sub-directory
public TDirectory dir(TPath path)
path - the relative path of the target directory to current directory
@Deprecated
public TDirectory[] listDirs()
throws TIoException
TIoException - for error in reading the directory
@Deprecated
public TDirectory[] listDirs(TDirectoryFilter directoryFilter)
throws TIoException
directoryFilter - filter for the directory
TIoException - for error in reading the directory
public TDirectoryListing list()
throws TIoException
TIoException - for error in reading current directory
public TDirectoryListing list(TEntryFilter filter)
throws TIoException
filter - entry filter
TIoException - for error in reading current directory
public TDirectoryListing list(TFileFilter filter)
throws TIoException
filter - file filter
TIoException - for error in reading current directory
public TDirectoryListing list(TDirectoryFilter filter)
throws TIoException
filter - directory filter
TIoException - for error in reading current directory
public TDirectoryListing list(TDirectoryFilter directoryFilter,
TFileFilter fileFilter)
throws TIoException
directoryFilter - directory filterfileFilter - file filter
TIoException - for error in reading current directory
@Deprecated
public TFile[] listFiles()
throws TIoException
TIoException - error in reading from current directory
@Deprecated
public TFile[] listFiles(TFileFilter fileFilter)
throws TIoException
fileFilter - file filter for the list
TIoException - error in reading from current directory
public void delete()
throws TIoException
TIoException - error in deleting the directory (most file system will fail when directory is not empty)
public void deleteAll()
throws TIoException
TIoException - error in the operation
public void mergeTo(TDirectory target)
throws TIoException
TIoException
public void moveTo(TDirectory target)
throws TIoException
TIoException@Deprecated public java.io.File getJavaFile()
public void zipTo(TFile file)
throws TIoException
file - the target file
TIoException - error in reading from the directory or writing to the file
public void visit(FileVisitor fileVisitor)
throws TIoException
TIoExceptionpublic TDirectory toCanonicalDir()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||