|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object vfs.VFSDirectory
public class VFSDirectory
A VFSDirectory is a container for VFSItem objects in a virtual file system. In addition to VFSItem methods, it has methods for accessing files and subdirectories.
This is a Composite class in a Composite design pattern whose other classes are VFSItem (Component) and VFSFile (Leaf).
Constructor Summary | |
---|---|
VFSDirectory(java.lang.String nm,
VFSDirectory par)
new VFSDirectory(nm, par) returns a virtual directory named nm whose parent is par. |
|
VFSDirectory(java.net.URL url)
new VFSDirectory(url) returns a virtual file system root directory representing the directory whose URL is url. |
Method Summary | |
---|---|
protected VFSFile |
addFile(java.lang.String nm)
addFile(nm) adds the file named nm to this VFSDirectory. |
protected void |
addSubdirectory(VFSDirectory dir)
d.addSubdirectory(nm) adds the subdirectory named nm to d. |
void |
escort(VFSVisitor v)
d.escort(v) escorts v through the directories and files descending from d. |
VFSFile |
getFile(java.lang.String nm)
d.getFile(nm) returns the file named nm in d or null if there is no such file. |
java.util.Iterator<java.lang.String> |
getFileNames()
d.getFileNames() returns an iterator for the names of file in d. |
java.util.Iterator<VFSFile> |
getFiles()
d.getFiles() returns an iterator for the files in d. |
java.lang.String |
getName()
d.getName() returns the name of d. |
java.util.Iterator<VFSDirectory> |
getSubdirectories()
d.getSubdirectories() returns an iterator for the subdirectories of d. |
VFSDirectory |
getSubdirectory(java.lang.String nm)
d.getFile(nm) returns the subdirectory named nm in d or null if there is no such subdirectory. |
java.util.Iterator<java.lang.String> |
getSubdirectoryNames()
d.getSubdirectoryNames() returns an iterator for the names of subdirectories of d. |
java.net.URL |
getURL()
v.getURL() returns the URL for d. |
boolean |
isRoot()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public VFSDirectory(java.net.URL url)
url
- the URL of the root directorypublic VFSDirectory(java.lang.String nm, VFSDirectory par)
nm
- the name of the directorypar
- its virtual file system parentMethod Detail |
---|
protected void addSubdirectory(VFSDirectory dir)
protected VFSFile addFile(java.lang.String nm)
public java.lang.String getName()
getName
in interface VFSItem
public java.net.URL getURL()
getURL
in interface VFSItem
public boolean isRoot()
public VFSFile getFile(java.lang.String nm)
public java.util.Iterator<VFSFile> getFiles()
public java.util.Iterator<java.lang.String> getFileNames()
public VFSDirectory getSubdirectory(java.lang.String nm)
public java.util.Iterator<VFSDirectory> getSubdirectories()
public java.util.Iterator<java.lang.String> getSubdirectoryNames()
public void escort(VFSVisitor v)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |