Class FileSystem

java.lang.Object
  |
  +--FileSystemAbstract
        |
        +--FileSystem

class FileSystem
extends FileSystemAbstract


Field Summary
protected  DirectoryBlock db
           
 Disk disk
           
protected  int f_index
           
protected  java.lang.String fname
           
 
Constructor Summary
FileSystem()
           
 
Method Summary
 short allocBlocks(int num_blocks)
           
 void append(java.lang.String name, byte[] buf, int bufLen)
           
private  void appendBase(java.lang.String name, byte[] buf, int bufLen)
           
(package private)  void checkDir(short blockPtr, int[] dir, int[] data)
           
protected  void checkDirectoryName(java.lang.String name)
           
(package private)  void checkFile(short blockPtr, int[] data)
           
 void create(java.lang.String name)
           
 void createDir(java.lang.String name)
           
 void deallocBlocks(short blockPtr)
           
 void delete(java.lang.String name)
           
 void deleteDir(java.lang.String name)
           
 void diskCheck()
           
 boolean existsDirectory(java.lang.String name)
           
 boolean existsFile(java.lang.String name)
           
 void fileAppend(java.lang.String fname1, java.lang.String fname2)
           
 void fileCopy(java.lang.String fname1, java.lang.String fname2)
           
 void fileExport(java.lang.String fname1, java.lang.String fname2)
           
 void fileImport(java.lang.String fname1, java.lang.String fname2)
           
private  byte[] fileRead(Inode inode, int fstart, int flength)
           
 DirectoryBlock findDirectory(java.lang.String name)
           
 void format()
           
 void getFileRef(java.lang.String name)
           
private  DirectoryBlock GetSubDir(DirectoryBlock db, int index)
           
 void list(java.lang.String name)
           
 void move(java.lang.String name1, java.lang.String name2)
           
 byte[] read(java.lang.String name)
           
 byte[] read(java.lang.String name, int offset, int length)
           
(package private)  void recDirList(int blocknum, java.lang.String parent)
           
 void tree()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

f_index

protected int f_index

db

protected DirectoryBlock db

fname

protected java.lang.String fname

disk

public Disk disk
Constructor Detail

FileSystem

public FileSystem()
Method Detail

findDirectory

public DirectoryBlock findDirectory(java.lang.String name)
                             throws FileSystemException
Specified by:
findDirectory in class FileSystemAbstract
FileSystemException

GetSubDir

private DirectoryBlock GetSubDir(DirectoryBlock db,
                                 int index)
                          throws FileSystemException
FileSystemException

list

public void list(java.lang.String name)
          throws FileSystemException
Specified by:
list in class FileSystemAbstract
FileSystemException

createDir

public void createDir(java.lang.String name)
               throws FileSystemException
Specified by:
createDir in class FileSystemAbstract
FileSystemException

deleteDir

public void deleteDir(java.lang.String name)
               throws FileSystemException
Specified by:
deleteDir in class FileSystemAbstract
FileSystemException

create

public void create(java.lang.String name)
            throws FileSystemException
Specified by:
create in class FileSystemAbstract
FileSystemException

delete

public void delete(java.lang.String name)
            throws FileSystemException
Specified by:
delete in class FileSystemAbstract
FileSystemException

fileRead

private byte[] fileRead(Inode inode,
                        int fstart,
                        int flength)
                 throws FileSystemException
FileSystemException

read

public byte[] read(java.lang.String name)
            throws FileSystemException
Specified by:
read in class FileSystemAbstract
FileSystemException

move

public void move(java.lang.String name1,
                 java.lang.String name2)
          throws FileSystemException
Specified by:
move in class FileSystemAbstract
FileSystemException

read

public byte[] read(java.lang.String name,
                   int offset,
                   int length)
            throws FileSystemException
Specified by:
read in class FileSystemAbstract
FileSystemException

append

public void append(java.lang.String name,
                   byte[] buf,
                   int bufLen)
            throws FileSystemException
Specified by:
append in class FileSystemAbstract
FileSystemException

getFileRef

public void getFileRef(java.lang.String name)
                throws FileSystemException
Specified by:
getFileRef in class FileSystemAbstract
FileSystemException

appendBase

private void appendBase(java.lang.String name,
                        byte[] buf,
                        int bufLen)
                 throws FileSystemException
FileSystemException

existsFile

public boolean existsFile(java.lang.String name)
                   throws FileSystemException
Specified by:
existsFile in class FileSystemAbstract
FileSystemException

existsDirectory

public boolean existsDirectory(java.lang.String name)
                        throws FileSystemException
Specified by:
existsDirectory in class FileSystemAbstract
FileSystemException

fileCopy

public void fileCopy(java.lang.String fname1,
                     java.lang.String fname2)
              throws FileSystemException
Specified by:
fileCopy in class FileSystemAbstract
FileSystemException

fileAppend

public void fileAppend(java.lang.String fname1,
                       java.lang.String fname2)
                throws FileSystemException
Specified by:
fileAppend in class FileSystemAbstract
FileSystemException

deallocBlocks

public void deallocBlocks(short blockPtr)
                   throws FileSystemException
Specified by:
deallocBlocks in class FileSystemAbstract
FileSystemException

allocBlocks

public short allocBlocks(int num_blocks)
                  throws FileSystemException
Specified by:
allocBlocks in class FileSystemAbstract
FileSystemException

recDirList

void recDirList(int blocknum,
                java.lang.String parent)
          throws FileSystemException
FileSystemException

tree

public void tree()
          throws FileSystemException
Specified by:
tree in class FileSystemAbstract
FileSystemException

format

public final void format()
                  throws FileSystemException
FileSystemException

checkDirectoryName

protected final void checkDirectoryName(java.lang.String name)
                                 throws FileSystemException
FileSystemException

fileImport

public final void fileImport(java.lang.String fname1,
                             java.lang.String fname2)
                      throws FileSystemException
FileSystemException

fileExport

public final void fileExport(java.lang.String fname1,
                             java.lang.String fname2)
                      throws FileSystemException
FileSystemException

checkFile

void checkFile(short blockPtr,
               int[] data)
         throws FileSystemException
FileSystemException

checkDir

void checkDir(short blockPtr,
              int[] dir,
              int[] data)
        throws FileSystemException
FileSystemException

diskCheck

public final void diskCheck()
                     throws FileSystemException
FileSystemException