de.waldheinz.fs
Interface FsDirectory

All Superinterfaces:
FsObject, Iterable<FsDirectoryEntry>
All Known Implementing Classes:
FatLfnDirectory

public interface FsDirectory
extends Iterable<FsDirectoryEntry>, FsObject

Base class for all FileSystem directories.

Author:
Ewout Prangsma < epr at jnode.org>, Matthias Treydte

Method Summary
 FsDirectoryEntry addDirectory(String name)
          Add a new (sub-)directory with a given name to this directory.
 FsDirectoryEntry addFile(String name)
          Add a new file with a given name to this directory.
 void flush()
          Save all dirty (unsaved) data to the device.
 FsDirectoryEntry getEntry(String name)
          Gets the entry with the given name.
 Iterator<FsDirectoryEntry> iterator()
          Gets an iterator to iterate over the entries of this directory.
 void remove(String name)
          Remove the entry with the given name from this directory.
 
Methods inherited from interface de.waldheinz.fs.FsObject
isReadOnly, isValid
 

Method Detail

iterator

Iterator<FsDirectoryEntry> iterator()
Gets an iterator to iterate over the entries of this directory.

Specified by:
iterator in interface Iterable<FsDirectoryEntry>
Returns:
the directory iterator

getEntry

FsDirectoryEntry getEntry(String name)
                          throws IOException
Gets the entry with the given name.

Parameters:
name - the name of the entry to get
Returns:
the entry, if it existed
Throws:
IOException - on error retrieving the entry

addFile

FsDirectoryEntry addFile(String name)
                         throws IOException
Add a new file with a given name to this directory.

Parameters:
name - the name of the file to add
Returns:
the entry pointing to the new file
Throws:
IOException - on error creating the file

addDirectory

FsDirectoryEntry addDirectory(String name)
                              throws IOException
Add a new (sub-)directory with a given name to this directory.

Parameters:
name - the name of the sub-directory to add
Returns:
the entry pointing to the new directory
Throws:
IOException - on error creating the directory

remove

void remove(String name)
            throws IOException
Remove the entry with the given name from this directory.

Parameters:
name - name of the entry to remove
Throws:
IOException - on error deleting the entry

flush

void flush()
           throws IOException
Save all dirty (unsaved) data to the device.

Throws:
IOException - on write error


Copyright © 2014. All rights reserved.