org.metasyntactic.io.filesystem
Interface Directory

All Superinterfaces:
Entry
All Known Implementing Classes:
AbstractDirectory

public interface Directory
extends Entry


Field Summary
static java.lang.String PARENT_DIRECTORY
          String representation that refers to this directory's parent.
static java.lang.String THIS_DIRECTORY
          String representation that refers to the current directory
 
Method Summary
 boolean addEntry(Entry entry)
          Adds the specified entry to this directory
 boolean containsEntry(Entry entry)
          Returns true if the specified entry is contained within this directory
 Entry getEntry(java.lang.String name)
          Returns the entry in this directory with this name, or null of that entry didn't exist.
 java.util.Date getLastModified()
          Returns the time that this Directory was last modified
 java.util.List listEntries()
          Returns an array of all the entries in this Directory.
 java.util.List listEntries(EntryFilter filter)
          Returns an array of all the entries in this Directory satisfying the specified filter
 void mount(FileSystem other, java.lang.String name)
          Mounts the specified FileSystem into this Directory with a name of "name"
 boolean removeEntry(Entry entry)
          Removes the specified entry from this directory
 FileSystem unMount(java.lang.String name)
          Unmounts the specified FileSystem making it unavailable from this directory
 
Methods inherited from interface org.metasyntactic.io.filesystem.Entry
delete, equals, getFileSystem, getName, getParent, getPath, hashCode, toString
 

Field Detail

THIS_DIRECTORY

public static final java.lang.String THIS_DIRECTORY
String representation that refers to the current directory

See Also:
Constant Field Values

PARENT_DIRECTORY

public static final java.lang.String PARENT_DIRECTORY
String representation that refers to this directory's parent. For example: /foo/bar/../baz is equivalent to /foo/baz

See Also:
Constant Field Values
Method Detail

mount

public void mount(FileSystem other,
                  java.lang.String name)
           throws NoPermissionException
Mounts the specified FileSystem into this Directory with a name of "name"

Throws:
NoPermissionException - when the User is not allowed to mount a FileSystem in this directory

unMount

public FileSystem unMount(java.lang.String name)
                   throws NoPermissionException
Unmounts the specified FileSystem making it unavailable from this directory

NoPermissionException

addEntry

public boolean addEntry(Entry entry)
                 throws NoPermissionException
Adds the specified entry to this directory

Returns:
true If and only if the addition was successful
NoPermissionException

removeEntry

public boolean removeEntry(Entry entry)
                    throws NoPermissionException
Removes the specified entry from this directory

NoPermissionException

containsEntry

public boolean containsEntry(Entry entry)
                      throws NoPermissionException
Returns true if the specified entry is contained within this directory

NoPermissionException

getEntry

public Entry getEntry(java.lang.String name)
               throws NoPermissionException
Returns the entry in this directory with this name, or null of that entry didn't exist.

Returns:
The entry that this name maps to
NoPermissionException

listEntries

public java.util.List listEntries()
                           throws NoPermissionException
Returns an array of all the entries in this Directory.

Returns:
An array of Entries representing all the Entries in this directory
Throws:
NoPermissionException - if the user does not have permission to list in this directory

listEntries

public java.util.List listEntries(EntryFilter filter)
                           throws NoPermissionException
Returns an array of all the entries in this Directory satisfying the specified filter

Returns:
An array of Entries representing all the Entries in this directory
Throws:
NoPermissionException - if the user does not have permission to list in this directory

getLastModified

public java.util.Date getLastModified()
Returns the time that this Directory was last modified