Class TestHFS

java.lang.Object
  extended byTestHFS

public class TestHFS
extends java.lang.Object

The TestHFS class provides a main method for testing the public methods of the HierarchicalFileSystem class.


Field Summary
private static java.lang.String cwd
          cwd is the current working directory without a trailing slash.
private static HierarchicalFileSystem hfs
          hfs is the test hierarchical file system.
 
Constructor Summary
private TestHFS(BaseFileSystem bfs)
          This constructor is disabled.
 
Method Summary
private static void cat(java.lang.String nm)
          cat(nm) changes the current working directory to nm.
private static void cd()
          cd() changes the current working directory to "/".
private static void cd(java.lang.String dir)
          cd(dir) changes the current working directory to dir.
private static void ls()
          ls() prints the contents of the current working directory.
static void main(java.lang.String[] args)
          main(args) is a program for testing the public methods of the HierarchicalFileSystem class.
private static void mk(java.lang.String nm)
          mk(nm) creates a new file named nm in the current working directory.
private static void mkdir(java.lang.String nm)
          mkdir(nm) creates a new subdirectory named nm in the current working directory.
private static java.lang.String path(java.lang.String nm)
          path(nm) returns the absolute path for nm.
private static void pwd()
          pwd() prints the current working directory.
private static void rm(java.lang.String nm)
          rm(nm) removes the file named nm from the current working directory.
private static void rmdir(java.lang.String nm)
          rmdir(nm) removes the subdirectory named nm from the current working directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

hfs

private static HierarchicalFileSystem hfs
hfs is the test hierarchical file system.


cwd

private static java.lang.String cwd
cwd is the current working directory without a trailing slash.

Constructor Detail

TestHFS

private TestHFS(BaseFileSystem bfs)
This constructor is disabled.

Method Detail

path

private static java.lang.String path(java.lang.String nm)
path(nm) returns the absolute path for nm.


cat

private static void cat(java.lang.String nm)
cat(nm) changes the current working directory to nm.


ls

private static void ls()
ls() prints the contents of the current working directory.


pwd

private static void pwd()
pwd() prints the current working directory.


cd

private static void cd()
cd() changes the current working directory to "/".


cd

private static void cd(java.lang.String dir)
cd(dir) changes the current working directory to dir.


mk

private static void mk(java.lang.String nm)
mk(nm) creates a new file named nm in the current working directory.


rm

private static void rm(java.lang.String nm)
rm(nm) removes the file named nm from the current working directory.


mkdir

private static void mkdir(java.lang.String nm)
mkdir(nm) creates a new subdirectory named nm in the current working directory.


rmdir

private static void rmdir(java.lang.String nm)
rmdir(nm) removes the subdirectory named nm from the current working directory.


main

public static void main(java.lang.String[] args)
main(args) is a program for testing the public methods of the HierarchicalFileSystem class.