com.aelitis.azureus.core.diskmanager.file.impl
Class FMFileAccessController

java.lang.Object
  extended by com.aelitis.azureus.core.diskmanager.file.impl.FMFileAccessController
All Implemented Interfaces:
FMFileAccess

public class FMFileAccessController
extends Object
implements FMFileAccess


Constructor Summary
protected FMFileAccessController(FMFileImpl _file, int _target_type)
           
 
Method Summary
 void aboutToOpen()
           
protected  void convert(int target_type)
           
 void flush()
           
 FMFileImpl getFile()
           
 long getLength(RandomAccessFile raf)
           
 int getStorageType()
           
 String getString()
           
 boolean isPieceCompleteProcessingNeeded(int piece_number)
           
 void read(RandomAccessFile raf, DirectByteBuffer[] buffers, long offset)
           
protected  void setControlFile()
           
 void setLength(RandomAccessFile raf, long length)
           
 void setPieceComplete(RandomAccessFile raf, int piece_number, DirectByteBuffer piece_data)
           
 void setStorageType(int new_type)
           
 void write(RandomAccessFile raf, DirectByteBuffer[] buffers, long position)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FMFileAccessController

protected FMFileAccessController(FMFileImpl _file,
                                 int _target_type)
                          throws FMFileManagerException
Throws:
FMFileManagerException
Method Detail

convert

protected void convert(int target_type)
                throws FMFileManagerException
Throws:
FMFileManagerException

setControlFile

protected void setControlFile()

setStorageType

public void setStorageType(int new_type)
                    throws FMFileManagerException
Throws:
FMFileManagerException

getStorageType

public int getStorageType()

aboutToOpen

public void aboutToOpen()
                 throws FMFileManagerException
Specified by:
aboutToOpen in interface FMFileAccess
Throws:
FMFileManagerException

getLength

public long getLength(RandomAccessFile raf)
               throws FMFileManagerException
Specified by:
getLength in interface FMFileAccess
Throws:
FMFileManagerException

setLength

public void setLength(RandomAccessFile raf,
                      long length)
               throws FMFileManagerException
Specified by:
setLength in interface FMFileAccess
Throws:
FMFileManagerException

isPieceCompleteProcessingNeeded

public boolean isPieceCompleteProcessingNeeded(int piece_number)
Specified by:
isPieceCompleteProcessingNeeded in interface FMFileAccess

setPieceComplete

public void setPieceComplete(RandomAccessFile raf,
                             int piece_number,
                             DirectByteBuffer piece_data)
                      throws FMFileManagerException
Specified by:
setPieceComplete in interface FMFileAccess
Throws:
FMFileManagerException

read

public void read(RandomAccessFile raf,
                 DirectByteBuffer[] buffers,
                 long offset)
          throws FMFileManagerException
Specified by:
read in interface FMFileAccess
Throws:
FMFileManagerException

write

public void write(RandomAccessFile raf,
                  DirectByteBuffer[] buffers,
                  long position)
           throws FMFileManagerException
Specified by:
write in interface FMFileAccess
Throws:
FMFileManagerException

flush

public void flush()
           throws FMFileManagerException
Specified by:
flush in interface FMFileAccess
Throws:
FMFileManagerException

getFile

public FMFileImpl getFile()
Specified by:
getFile in interface FMFileAccess

getString

public String getString()
Specified by:
getString in interface FMFileAccess