|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectHierarchicalFileSystem
A HierarchicalFileSystem represents a hierarchical file system in which files are referenced by UNIX style path names.
Field Summary | |
private BaseFileSystem |
base
base is the base file system wrapped by this hierarchical file system. |
private int |
root
root is the file number of the root directory of this hierarchical file system. |
Constructor Summary | |
HierarchicalFileSystem(BaseFileSystem bfs)
new HierarchicalFileSystem(bfs) returns a new hierarchical file system wrapper for the base file system bfs. |
Method Summary | |
private void |
checkTestPath(java.lang.String pth)
checkTestPath(pth) prints pth and its tail and last directory. |
void |
create(java.lang.String pth)
fs.create(pth) creates a regular file with absolute path pth in fs. |
void |
createDir(java.lang.String pth)
fs.createDir(pth) creates a new directory with absolute path pth in fs. |
void |
delete(java.lang.String pth)
fs.delete(pth) removes the regular file with absolute path pth from fs. |
void |
deleteDir(java.lang.String pth)
fs.deleteDir(pth) removes the directory with absolute path pth from fs. |
int |
getCapacity()
fs.getCapacity() returns the maximum number of files for fs. |
private Directory |
getLastDir(java.lang.String pth)
getLastDir(pth) returns the directory before the tail of pth or null if there is no such directory. |
private java.lang.String |
getTail(java.lang.String pth)
getTail(pth) returns the name at the tail of pth. |
private void |
initForTest()
initForTest() manually creates directories and files for testing purposes. |
static void |
main(java.lang.String[] args)
main(args) is a program for testing the private methods of the HierarchicalFileSystem class. |
File |
open(java.lang.String pth)
fs.open(pth) returns a file access structure for the file with absolute path pth. |
File |
openDir(java.lang.String pth)
fs.openDir(pth) returns a directory access structure for the directory with absolute path pth. |
java.lang.String |
toString()
fs.toString() returns the class name and file system name of fs as a string. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private BaseFileSystem base
private int root
Constructor Detail |
public HierarchicalFileSystem(BaseFileSystem bfs)
Method Detail |
private java.lang.String getTail(java.lang.String pth)
private Directory getLastDir(java.lang.String pth)
private void initForTest()
private void checkTestPath(java.lang.String pth)
public void create(java.lang.String pth)
An IllegalStateException is thrown
An IllegalArgumentException is thrown
public void createDir(java.lang.String pth)
An IllegalStateException is thrown
An IllegalArgumentException is thrown if any of the directories in pth except the last is missing.
public void delete(java.lang.String pth)
An IllegalArgumentException is thrown
public void deleteDir(java.lang.String pth)
An IllegalArgumentException is thrown
public File open(java.lang.String pth)
Null is returned
public File openDir(java.lang.String pth)
Null is returned
public int getCapacity()
public java.lang.String toString()
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |