org.gudy.azureus2.core3.download.impl
Class DownloadManagerController.fileInfoFacade

java.lang.Object
  extended by org.gudy.azureus2.core3.download.impl.DownloadManagerController.fileInfoFacade
All Implemented Interfaces:
DiskManagerFileInfo
Enclosing class:
DownloadManagerController

protected class DownloadManagerController.fileInfoFacade
extends Object
implements DiskManagerFileInfo


Field Summary
 
Fields inherited from interface org.gudy.azureus2.core3.disk.DiskManagerFileInfo
READ, ST_COMPACT, ST_LINEAR, ST_REORDER, ST_REORDER_COMPACT, WRITE
 
Constructor Summary
protected DownloadManagerController.fileInfoFacade()
           
 
Method Summary
 void addListener(DiskManagerFileInfoListener listener)
           
 void close()
           
 void flushCache()
           
 int getAccessMode()
           
 DiskManager getDiskManager()
           
 long getDownloaded()
           
 DownloadManager getDownloadManager()
           
 long getETA()
           
 String getExtension()
           
 File getFile(boolean follow_link)
           
 int getFirstPieceNumber()
           
 int getIndex()
           
 int getLastPieceNumber()
           
 long getLength()
           
 File getLink()
           
 int getNbPieces()
           
 int getPriority()
           
 int getReadBytesPerSecond()
           
 int getStorageType()
           
 TOTorrentFile getTorrentFile()
           
 int getWriteBytesPerSecond()
           
 boolean isSkipped()
           
 DirectByteBuffer read(long offset, int length)
           
 void removeListener(DiskManagerFileInfoListener listener)
           
protected  void setDelegate(DiskManagerFileInfo new_delegate)
           
 boolean setLink(File link_destination)
          Relink the file to the destination given - this method deals with if the file is part of a simple torrent or not (so it may set the download name to keep it in sync).
 boolean setLinkAtomic(File link_destination)
           
 void setPriority(int b)
           
 void setSkipped(boolean b)
           
 boolean setStorageType(int type)
          Download must be stopped before calling this!
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DownloadManagerController.fileInfoFacade

protected DownloadManagerController.fileInfoFacade()
Method Detail

setDelegate

protected void setDelegate(DiskManagerFileInfo new_delegate)

setPriority

public void setPriority(int b)
Specified by:
setPriority in interface DiskManagerFileInfo

setSkipped

public void setSkipped(boolean b)
Specified by:
setSkipped in interface DiskManagerFileInfo

setLink

public boolean setLink(File link_destination)
Description copied from interface: DiskManagerFileInfo
Relink the file to the destination given - this method deals with if the file is part of a simple torrent or not (so it may set the download name to keep it in sync). If you just want a simple relink, use setLinkAtomic.

Specified by:
setLink in interface DiskManagerFileInfo
Returns:

setLinkAtomic

public boolean setLinkAtomic(File link_destination)
Specified by:
setLinkAtomic in interface DiskManagerFileInfo

getLink

public File getLink()
Specified by:
getLink in interface DiskManagerFileInfo

setStorageType

public boolean setStorageType(int type)
Description copied from interface: DiskManagerFileInfo
Download must be stopped before calling this!

Specified by:
setStorageType in interface DiskManagerFileInfo
Parameters:
type - one of ST_LINEAR or ST_COMPACT

getStorageType

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

getAccessMode

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

getDownloaded

public long getDownloaded()
Specified by:
getDownloaded in interface DiskManagerFileInfo

getExtension

public String getExtension()
Specified by:
getExtension in interface DiskManagerFileInfo

getFirstPieceNumber

public int getFirstPieceNumber()
Specified by:
getFirstPieceNumber in interface DiskManagerFileInfo

getLastPieceNumber

public int getLastPieceNumber()
Specified by:
getLastPieceNumber in interface DiskManagerFileInfo

getLength

public long getLength()
Specified by:
getLength in interface DiskManagerFileInfo

getNbPieces

public int getNbPieces()
Specified by:
getNbPieces in interface DiskManagerFileInfo

getPriority

public int getPriority()
Specified by:
getPriority in interface DiskManagerFileInfo

isSkipped

public boolean isSkipped()
Specified by:
isSkipped in interface DiskManagerFileInfo

getIndex

public int getIndex()
Specified by:
getIndex in interface DiskManagerFileInfo

getDiskManager

public DiskManager getDiskManager()
Specified by:
getDiskManager in interface DiskManagerFileInfo

getDownloadManager

public DownloadManager getDownloadManager()
Specified by:
getDownloadManager in interface DiskManagerFileInfo

getFile

public File getFile(boolean follow_link)
Specified by:
getFile in interface DiskManagerFileInfo

getTorrentFile

public TOTorrentFile getTorrentFile()
Specified by:
getTorrentFile in interface DiskManagerFileInfo

flushCache

public void flushCache()
                throws Exception
Specified by:
flushCache in interface DiskManagerFileInfo
Throws:
Exception

read

public DirectByteBuffer read(long offset,
                             int length)
                      throws IOException
Specified by:
read in interface DiskManagerFileInfo
Throws:
IOException

getReadBytesPerSecond

public int getReadBytesPerSecond()
Specified by:
getReadBytesPerSecond in interface DiskManagerFileInfo

getWriteBytesPerSecond

public int getWriteBytesPerSecond()
Specified by:
getWriteBytesPerSecond in interface DiskManagerFileInfo

getETA

public long getETA()
Specified by:
getETA in interface DiskManagerFileInfo

close

public void close()
Specified by:
close in interface DiskManagerFileInfo

addListener

public void addListener(DiskManagerFileInfoListener listener)
Specified by:
addListener in interface DiskManagerFileInfo

removeListener

public void removeListener(DiskManagerFileInfoListener listener)
Specified by:
removeListener in interface DiskManagerFileInfo