rossi.fstools.fs
Interface FileSystem

All Known Implementing Classes:
Ext2FileSystem, FatFileSystem, ReiserFileSystem

public interface FileSystem

Representation of a file system. This is the main interface applications will use to interface to a filesytem. Methods are provided here for navigating the filesystem.


Method Summary
 void close()
          Close the underlying BlockReader used by this file system.
 Inode getInode(InodePtr ptr)
          Get an Inode given a point to it.
 FsObject getObject(Inode inode)
          Get the filesystem object represented by an inode.
 InodePtr getRootDir()
          Get a pointer to the root directory's inode.
 SuperBlock open(BlockReader br)
          Open a file system for reading.
 

Method Detail

open

public SuperBlock open(BlockReader br)
                throws FsException,
                       java.io.IOException
Open a file system for reading. The BlockReader should be initialized to point to the phyical storage of the desired filesystem.

Parameters:
br - a BlockReader for accessing the physical filesystem.
Returns:
the filesystem's SuperBlock
Throws:
FsException - if the superblock cannot be parsed.
java.io.IOException

close

public void close()
           throws java.io.IOException
Close the underlying BlockReader used by this file system.

Throws:
java.io.IOException

getRootDir

public InodePtr getRootDir()
Get a pointer to the root directory's inode.

Returns:
InodePtr pointing to the root directory.

getInode

public Inode getInode(InodePtr ptr)
               throws FsException,
                      java.io.IOException
Get an Inode given a point to it. May return null if the Inode does not exist.

Parameters:
ptr - an InodePtr
Returns:
Inode pointed to by ptr
Throws:
FsException - if the Inode cannot be parsed.
java.io.IOException - if an IO error occurs

getObject

public FsObject getObject(Inode inode)
                   throws FsException,
                          java.io.IOException
Get the filesystem object represented by an inode.

Parameters:
inode - an Inode
Returns:
FsObject that is represented by the inode
Throws:
FsException - if the object cannot be parsed.
java.io.IOException - if an IO error occurs.