|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface VfsDirectory
A directory in a Virtual File System (Vfs).
VFSDirectories act just like directories in a typical filesystem. They can contain other files or subdirectories. From a behavioral perspective, VFSDirectories serve as the focus of listing and finding activities in a Vfs.
Methods starting with "list" list the directory's direct children only (not nodes beneath subdirectories). These methods are analogous to the Unix "ls" command.
Methods starting with "find" list the directory's direct children and also descendents in subdirectories (and subdirectories of the subdirectories, and so forth). These methods are analogous to the Unix "find" command.
"List" and "find" methods with no arguments return all items of the specified type. Those that end with "Like" and take a regular-expression argument allow you to filter the results, e.g.
results = vfsdir.listFilesLike("*.txt");
Methods starting with "create" create a VfsDirectory or VfsFile with the given name or path. This directory or file does not have to exist.
Concrete implementations of VfsDirectory are provided by a VFSModule.
Copyright 2006 Partner Software, Inc.
| Method Summary | |
|---|---|
VfsDirectory |
copyTo(Path path)
Does a recursive copy of this directory's contents to the path provided in the same Vfs. |
VfsDirectory |
copyTo(VfsDirectory destination)
Does a recursive copy of this directory's contents to the directory provided. |
VfsDirectory |
directoryFor(Path path)
Creates a new subdirectory address object, placed relative to this directory according to the given path. |
VfsDirectory |
directoryFor(java.lang.String pathString)
Same as directoryFor(new Path(pathString)). |
VfsDirectory |
directoryNamed(java.lang.String name)
Creates a new subdirectory address object, placed within this directory, with the given name. |
boolean |
exists()
Whether the Vfs node exists. |
VfsFile |
fileFor(Path path)
Creates a new file address object, placed within relative to this directory according to the given path. |
VfsFile |
fileFor(java.lang.String pathString)
Same as fileFor(new Path(pathString)). |
VfsFile |
fileNamed(java.lang.String name)
Creates a new file address object, placed within this directory, with the given name. |
java.util.List<VfsDirectory> |
findDirectories()
Does a recursive, downward search through the descendents of this directory, returning all directories (not files) found. |
java.util.List<VfsDirectory> |
findDirectoriesLike(java.lang.String pattern)
Does a recursive, downward search through the descendents of this directory, returning all directories (not files) found that match the given pattern. |
java.util.List<VfsFile> |
findFiles()
Does a recursive, downward search through the descendents of this directory, returning the files (not directories) found. |
java.util.List<VfsFile> |
findFilesLike(java.lang.String pattern)
Does a recursive, downward search through the descendents of this directory, returning all files (not directories) found that match the given pattern. |
java.util.List<VfsFile> |
findFilesWithExtension(java.lang.String extension)
Does a recursive, downward search through the descendents of this directory, returning all files (not directories) found that have the given extension. |
java.util.List<VfsNode> |
findNodes()
Does a recursive, downward search through the descendents of this directory, returning all nodes (files and directories) found. |
java.util.List<VfsNode> |
findNodesLike(java.lang.String pattern)
Does a recursive, downward search through the descendents of this directory, returning all nodes (files and directories) found that match the given pattern. |
java.util.List<VfsDirectory> |
listDirectories()
Lists all directories (not files) in this directory. |
java.util.List<VfsDirectory> |
listDirectoriesLike(java.lang.String pattern)
Lists all directories (not files) in this directory with the given regular expression pattern. |
java.util.List<VfsFile> |
listFiles()
Lists all files (not directories) in this directory. |
java.util.List<VfsFile> |
listFilesLike(java.lang.String pattern)
Lists all files (not directories) in this directory with the given regular expression pattern. |
java.util.List<VfsFile> |
listFilesWithBaseName(java.lang.String baseName)
Lists all files (not directories) in this directory with the basename (name without extension) You should not include the period (.) |
java.util.List<VfsFile> |
listFilesWithExtension(java.lang.String extension)
Lists all files (not directories) in this directory with the given extension. |
java.util.List<VfsNode> |
listNodes()
Lists all nodes (both directories and files) in this directory. |
java.util.List<VfsNode> |
listNodesLike(java.lang.String pattern)
Lists all nodes (both directories and files) in this directory with the given regular expression pattern. |
void |
make()
Creates the node and any ancestor directories needed to contain it. |
VfsDirectory |
moveTo(Path newPath)
Moves the file to the new path on the same Vfs. |
VfsDirectory |
moveTo(VfsDirectory destination)
Moves the file to the destination given. |
void |
remove()
Removes the directory AND ALL ITS CONTENTS. |
VfsDirectory |
renameTo(java.lang.String name)
Renames the directory. |
| Methods inherited from interface com.partnersoft.io.vfs.VfsNode |
|---|
getAbsolutePath, getBaseName, getDirectory, getExtension, getName, getPath, getUri, getUrl, getVfs, isBackup, isHidden, toFile |
| Method Detail |
|---|
boolean exists()
throws java.io.IOException
VfsNodeVfsNode.make() to create the node if it does not exist.
exists in interface VfsNodejava.io.IOException - if it can't tell for some reason.
void make()
throws java.io.IOException
VfsNode
make in interface VfsNodejava.io.IOException - if it can't.VfsDirectory directoryNamed(java.lang.String name)
Path object and use the pathwise version for
that.
Note that this creates a new VfsDirectory address object, but does NOT
make the actual filesystem directory if it does not exist. Use the
make() method for that.
name - name of subdirectory
VfsFile fileNamed(java.lang.String name)
Path object and use the pathwise version for
that.
Note that this creates a new VfsFile address object, but does NOT make
the actual file object if it does not exist. Use the make()
method for that.
name - name of file
VfsDirectory directoryFor(Path path)
Note that this creates a new VfsDirectory address object, but does NOT
make the actual filesystem directory if it does not exist. Use the
make() method for that.
path - to subdirectory
VfsDirectory directoryFor(java.lang.String pathString)
VfsFile fileFor(Path path)
Note that this creates a new VfsFile address object, but does NOT make
the actual file object if it does not exist. Use the make()
method for that.
path - path to file
VfsFile fileFor(java.lang.String pathString)
java.util.List<VfsNode> listNodes()
throws java.io.IOException
java.io.IOException - if listing fails
java.util.List<VfsFile> listFiles()
throws java.io.IOException
java.io.IOException
java.util.List<VfsDirectory> listDirectories()
throws java.io.IOException
java.io.IOException
java.util.List<VfsNode> listNodesLike(java.lang.String pattern)
throws java.io.IOException
pattern - regular expression pattern
java.io.IOExceptionPattern
java.util.List<VfsFile> listFilesLike(java.lang.String pattern)
throws java.io.IOException
pattern - regular expression pattern
java.io.IOExceptionPattern
java.util.List<VfsFile> listFilesWithExtension(java.lang.String extension)
throws java.io.IOException
extension - file extension
java.io.IOException
java.util.List<VfsFile> listFilesWithBaseName(java.lang.String baseName)
throws java.io.IOException
baseName - base name to look for
java.io.IOException
java.util.List<VfsDirectory> listDirectoriesLike(java.lang.String pattern)
throws java.io.IOException
pattern - regular expression pattern
java.io.IOExceptionPattern
java.util.List<VfsNode> findNodes()
throws java.io.IOException
java.io.IOException - if something bad happens
java.util.List<VfsFile> findFiles()
throws java.io.IOException
java.io.IOException - if something bad happens
java.util.List<VfsDirectory> findDirectories()
throws java.io.IOException
java.io.IOException - if something bad happens
java.util.List<VfsNode> findNodesLike(java.lang.String pattern)
throws java.io.IOException
pattern - regular expression pattern
java.io.IOException - if something bad happensPattern
java.util.List<VfsDirectory> findDirectoriesLike(java.lang.String pattern)
throws java.io.IOException
pattern - regular expression pattern
java.io.IOException - if something bad happensPattern
java.util.List<VfsFile> findFilesLike(java.lang.String pattern)
throws java.io.IOException
pattern - regular expression pattern
java.io.IOException - if something bad happensPattern
java.util.List<VfsFile> findFilesWithExtension(java.lang.String extension)
throws java.io.IOException
extension - file extension
java.io.IOException - if something bad happensPattern
VfsDirectory copyTo(VfsDirectory destination)
throws java.io.IOException
java.io.IOException
VfsDirectory copyTo(Path path)
throws java.io.IOException
java.io.IOException
void remove()
throws java.io.IOException
java.io.IOException
VfsDirectory renameTo(java.lang.String name)
throws java.io.IOException
java.io.IOException
VfsDirectory moveTo(Path newPath)
throws java.io.IOException
java.io.IOException
VfsDirectory moveTo(VfsDirectory destination)
throws java.io.IOException
java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||