org.metasyntactic.io.filesystem
Class AbstractFileSystem

java.lang.Object
  |
  +--org.metasyntactic.io.filesystem.AbstractFileSystem
All Implemented Interfaces:
FileSystem
Direct Known Subclasses:
DOMFileSystem, IMAPFileSystem, ZipFileSystem

public abstract class AbstractFileSystem
extends java.lang.Object
implements FileSystem


Field Summary
protected  Directory mountedIn
          The Directory (of another FileSystem) that I am mounted in
 
Fields inherited from interface org.metasyntactic.io.filesystem.FileSystem
ESCAPE, ESCAPE_CHAR, SEPARATOR, SEPARATOR_CHAR
 
Constructor Summary
AbstractFileSystem()
           
 
Method Summary
 Entry getEntry(java.lang.String name)
          Returns the entry denoted by this abstract path string.
 Entry getEntry(java.lang.String name, Directory start)
           
 Directory getParent()
          Returns the Directory of the FileSystem that this FileSystem is mounted in, or null if this FileSystem is not mounted in another
static void main(java.lang.String[] args)
           
 void mount(FileSystem other, Directory mountInto, java.lang.String name)
          Mounts the other file system into the specified directroy of this file system and gives it the name "name"
 void mount(FileSystem other, java.lang.String name)
           
 Directory setParent(Directory dir)
          Sets the directory that this FileSystem is mounted in.
 java.lang.String toString()
           
 FileSystem unMount(Directory mountedInto, java.lang.String name)
          Unmounts the FileSystem with hte given name from teh specified directory and returns it
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.metasyntactic.io.filesystem.FileSystem
getRoot
 

Field Detail

mountedIn

protected Directory mountedIn
The Directory (of another FileSystem) that I am mounted in

Constructor Detail

AbstractFileSystem

public AbstractFileSystem()
Method Detail

mount

public void mount(FileSystem other,
                  java.lang.String name)
           throws NoPermissionException
NoPermissionException

mount

public void mount(FileSystem other,
                  Directory mountInto,
                  java.lang.String name)
           throws NoPermissionException
Description copied from interface: FileSystem
Mounts the other file system into the specified directroy of this file system and gives it the name "name"

Specified by:
mount in interface FileSystem
NoPermissionException

unMount

public FileSystem unMount(Directory mountedInto,
                          java.lang.String name)
                   throws NoPermissionException
Description copied from interface: FileSystem
Unmounts the FileSystem with hte given name from teh specified directory and returns it

Specified by:
unMount in interface FileSystem
Returns:
The now Unmounted FileSystem
NoPermissionException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getEntry

public Entry getEntry(java.lang.String name)
               throws NoPermissionException,
                      EntryNotFoundException
Description copied from interface: FileSystem
Returns the entry denoted by this abstract path string.

Specified by:
getEntry in interface FileSystem
NoPermissionException
EntryNotFoundException

getParent

public Directory getParent()
Description copied from interface: FileSystem
Returns the Directory of the FileSystem that this FileSystem is mounted in, or null if this FileSystem is not mounted in another

Specified by:
getParent in interface FileSystem

setParent

public Directory setParent(Directory dir)
Description copied from interface: FileSystem
Sets the directory that this FileSystem is mounted in. Should only be called by the mounting FileSystem. Returns the old value that getParent() would have returned

Specified by:
setParent in interface FileSystem

getEntry

public Entry getEntry(java.lang.String name,
                      Directory start)
               throws NoPermissionException,
                      EntryNotFoundException
NoPermissionException
EntryNotFoundException

main

public static void main(java.lang.String[] args)