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

java.lang.Object
  extended by com.aelitis.azureus.core.diskmanager.file.impl.FMFileImpl
All Implemented Interfaces:
FMFile
Direct Known Subclasses:
FMFileLimited, FMFileUnlimited

public abstract class FMFileImpl
extends Object
implements FMFile


Field Summary
protected static String READ_ACCESS_MODE
           
protected  AEMonitor this_mon
           
protected static String WRITE_ACCESS_MODE
           
 
Fields inherited from interface com.aelitis.azureus.core.diskmanager.file.FMFile
FM_READ, FM_WRITE, FT_COMPACT, FT_LINEAR, FT_PIECE_REORDER, FT_PIECE_REORDER_COMPACT
 
Constructor Summary
protected FMFileImpl(FMFileImpl basis)
           
protected FMFileImpl(FMFileOwner _owner, FMFileManagerImpl _manager, File _file, int _type)
           
 
Method Summary
protected  void closeSupport(boolean explicit)
           
protected  void createDirs(File target)
           
 void delete()
           
protected  void deleteDirs()
           
 void ensureOpen(String reason)
           
 boolean exists()
           
 void flush()
           
protected static void generateEvidence(IndentWriter writer)
           
 int getAccessMode()
           
protected  long getLengthSupport()
           
protected  File getLinkedFile()
           
protected  FMFileManagerImpl getManager()
           
 String getName()
           
 FMFileOwner getOwner()
           
 int getStorageType()
           
protected  String getString()
           
 boolean isClone()
           
 boolean isOpen()
           
protected  boolean isPieceCompleteProcessingNeeded(int piece_number)
           
 void moveFile(File new_unlinked_file)
           
protected  void openSupport(String reason)
           
protected  void readSupport(DirectByteBuffer[] buffers, long position)
           
protected  void readSupport(DirectByteBuffer buffer, long position)
           
 void renameFile(String new_name)
           
protected  void reopen(FMFileManagerException cause)
           
protected  void setAccessModeSupport(int mode)
           
protected  void setLengthSupport(long length)
           
protected  void setPieceCompleteSupport(int piece_number, DirectByteBuffer piece_data)
           
 void setStorageType(int new_type)
           
protected  void writeSupport(DirectByteBuffer[] buffers, long position)
           
protected  void writeSupport(DirectByteBuffer buffer, long position)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.aelitis.azureus.core.diskmanager.file.FMFile
close, createClone, getLength, read, read, setAccessMode, setLength, setPieceComplete, write, write
 

Field Detail

READ_ACCESS_MODE

protected static final String READ_ACCESS_MODE
See Also:
Constant Field Values

WRITE_ACCESS_MODE

protected static final String WRITE_ACCESS_MODE
See Also:
Constant Field Values

this_mon

protected final AEMonitor this_mon
Constructor Detail

FMFileImpl

protected FMFileImpl(FMFileOwner _owner,
                     FMFileManagerImpl _manager,
                     File _file,
                     int _type)
              throws FMFileManagerException
Throws:
FMFileManagerException

FMFileImpl

protected FMFileImpl(FMFileImpl basis)
              throws FMFileManagerException
Throws:
FMFileManagerException
Method Detail

getManager

protected FMFileManagerImpl getManager()

getName

public String getName()
Specified by:
getName in interface FMFile

exists

public boolean exists()
Specified by:
exists in interface FMFile

getOwner

public FMFileOwner getOwner()
Specified by:
getOwner in interface FMFile

isClone

public boolean isClone()
Specified by:
isClone in interface FMFile

setStorageType

public void setStorageType(int new_type)
                    throws FMFileManagerException
Specified by:
setStorageType in interface FMFile
Throws:
FMFileManagerException

getStorageType

public int getStorageType()
Specified by:
getStorageType in interface FMFile

getAccessMode

public int getAccessMode()
Specified by:
getAccessMode in interface FMFile

setAccessModeSupport

protected void setAccessModeSupport(int mode)

getLinkedFile

protected File getLinkedFile()

moveFile

public void moveFile(File new_unlinked_file)
              throws FMFileManagerException
Specified by:
moveFile in interface FMFile
Throws:
FMFileManagerException

renameFile

public void renameFile(String new_name)
                throws FMFileManagerException
Specified by:
renameFile in interface FMFile
Throws:
FMFileManagerException

ensureOpen

public void ensureOpen(String reason)
                throws FMFileManagerException
Specified by:
ensureOpen in interface FMFile
Throws:
FMFileManagerException

getLengthSupport

protected long getLengthSupport()
                         throws FMFileManagerException
Throws:
FMFileManagerException

setLengthSupport

protected void setLengthSupport(long length)
                         throws FMFileManagerException
Throws:
FMFileManagerException

reopen

protected void reopen(FMFileManagerException cause)
               throws Throwable
Throws:
Throwable

openSupport

protected void openSupport(String reason)
                    throws FMFileManagerException
Throws:
FMFileManagerException

closeSupport

protected void closeSupport(boolean explicit)
                     throws FMFileManagerException
Throws:
FMFileManagerException

flush

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

isPieceCompleteProcessingNeeded

protected boolean isPieceCompleteProcessingNeeded(int piece_number)
                                           throws FMFileManagerException
Throws:
FMFileManagerException

setPieceCompleteSupport

protected void setPieceCompleteSupport(int piece_number,
                                       DirectByteBuffer piece_data)
                                throws FMFileManagerException
Throws:
FMFileManagerException

delete

public void delete()
            throws FMFileManagerException
Specified by:
delete in interface FMFile
Throws:
FMFileManagerException

readSupport

protected void readSupport(DirectByteBuffer buffer,
                           long position)
                    throws FMFileManagerException
Throws:
FMFileManagerException

readSupport

protected void readSupport(DirectByteBuffer[] buffers,
                           long position)
                    throws FMFileManagerException
Throws:
FMFileManagerException

writeSupport

protected void writeSupport(DirectByteBuffer buffer,
                            long position)
                     throws FMFileManagerException
Throws:
FMFileManagerException

writeSupport

protected void writeSupport(DirectByteBuffer[] buffers,
                            long position)
                     throws FMFileManagerException
Throws:
FMFileManagerException

isOpen

public boolean isOpen()
Specified by:
isOpen in interface FMFile

createDirs

protected void createDirs(File target)
                   throws FMFileManagerException
Throws:
FMFileManagerException

deleteDirs

protected void deleteDirs()

getString

protected String getString()

generateEvidence

protected static void generateEvidence(IndentWriter writer)