rossi.fstools.fs.fatfs
Class FatFileSystem

java.lang.Object
  extended byrossi.fstools.fs.fatfs.FatFileSystem
All Implemented Interfaces:
FileSystem

public class FatFileSystem
extends java.lang.Object
implements FileSystem

Implementation of the FAT 12/16/32 file systems.


Constructor Summary
FatFileSystem()
           
 
Method Summary
 void close()
          Close the underlying BlockReader used by this file system.
 Directory createFatDirectory(FatDirEntry inode)
          Create a directory.
 File createFatFile(FatDirEntry inode)
          Creates a file from an inode
 Inode getInode(InodePtr ptr)
          Gets an inode.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FatFileSystem

public FatFileSystem()
Method Detail

open

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

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

close

public void close()
           throws java.io.IOException
Description copied from interface: FileSystem
Close the underlying BlockReader used by this file system.

Specified by:
close in interface FileSystem
Throws:
java.io.IOException

getRootDir

public InodePtr getRootDir()
Description copied from interface: FileSystem
Get a pointer to the root directory's inode.

Specified by:
getRootDir in interface FileSystem
Returns:
InodePtr pointing to the root directory.

getInode

public Inode getInode(InodePtr ptr)
               throws FsException,
                      java.io.IOException
Gets an inode. In this case the ptr is the inode.

Specified by:
getInode in interface FileSystem
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

createFatFile

public File createFatFile(FatDirEntry inode)
                   throws FsException,
                          java.io.IOException
Creates a file from an inode

Parameters:
inode - the inode
Returns:
the file
Throws:
java.io.IOException - in case of an IO error
FSException - in case of a FS format error
FsException

createFatDirectory

public Directory createFatDirectory(FatDirEntry inode)
                             throws FsException,
                                    java.io.IOException
Create a directory.

Parameters:
inode - a Ext2Inode
Returns:
Directory
Throws:
FsException
java.io.IOException

getObject

public FsObject getObject(Inode inode)
                   throws FsException,
                          java.io.IOException
Description copied from interface: FileSystem
Get the filesystem object represented by an inode.

Specified by:
getObject in interface FileSystem
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.