Class DownloadManagerController.fileInfoFacade
java.lang.Object
com.biglybt.core.download.impl.DownloadManagerController.fileInfoFacade
- All Implemented Interfaces:
DiskManagerFileInfo
- Enclosing class:
DownloadManagerController
protected class DownloadManagerController.fileInfoFacade
extends Object
implements DiskManagerFileInfo
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate DiskManagerFileInfoprivate List<DiskManagerFileInfoListener> Fields inherited from interface DiskManagerFileInfo
READ, ST_COMPACT, ST_LINEAR, ST_REORDER, ST_REORDER_COMPACT, WRITE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(DiskManagerFileInfoListener listener) voidclose()booleanexists()Checks that the linked file exists (always returns true for pad files)voidintlonglonggetETA()getFile(boolean follow_link) intintgetIndex()longintlonggetLink()intintFile Download PriorityintintReturns the storage type for this fileintbooleanSkipped files don't get downloaded.read(long offset, int length) voidrecheck()voidremoveListener(DiskManagerFileInfoListener listener) protected voidsetDelegate(DiskManagerFileInfo new_delegate) booleanRelink 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).booleansetLinkAtomic(File link_destination, boolean no_delete) booleansetLinkAtomic(File link_destination, boolean no_delete, FileUtil.ProgressListener pl) voidsetPriority(int b) voidsetSkipped(boolean b) booleansetStorageType(int type, boolean force) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface DiskManagerFileInfo
isLinked, isMetadataDownload, setStorageType
-
Field Details
-
delegate
-
listeners
-
-
Constructor Details
-
fileInfoFacade
protected fileInfoFacade()
-
-
Method Details
-
setDelegate
-
setPriority
public void setPriority(int b) - Specified by:
setPriorityin interfaceDiskManagerFileInfo
-
setSkipped
public void setSkipped(boolean b) - Specified by:
setSkippedin interfaceDiskManagerFileInfo
-
isSkipping
- Specified by:
isSkippingin interfaceDiskManagerFileInfo
-
setLink
Description copied from interface:DiskManagerFileInfoRelink 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:
setLinkin interfaceDiskManagerFileInfo- Parameters:
link_destination-- Returns:
- true - worked, false - failed, use getLastError to possibly get some extra info
-
getLastError
- Specified by:
getLastErrorin interfaceDiskManagerFileInfo
-
setLinkAtomic
- Specified by:
setLinkAtomicin interfaceDiskManagerFileInfo
-
setLinkAtomic
public boolean setLinkAtomic(File link_destination, boolean no_delete, FileUtil.ProgressListener pl) - Specified by:
setLinkAtomicin interfaceDiskManagerFileInfo
-
getLink
- Specified by:
getLinkin interfaceDiskManagerFileInfo
-
setStorageType
public boolean setStorageType(int type, boolean force) - Specified by:
setStorageTypein interfaceDiskManagerFileInfo- Parameters:
type-force- discards any existing file content if it exists - use with care...- Returns:
-
getStorageType
public int getStorageType()Description copied from interface:DiskManagerFileInfoReturns the storage type for this file- Specified by:
getStorageTypein interfaceDiskManagerFileInfo- Returns:
DiskManagerFileInfo.ST_LINEAR,DiskManagerFileInfo.ST_COMPACT,DiskManagerFileInfo.ST_REORDER,DiskManagerFileInfo.ST_REORDER_COMPACT
-
getAccessMode
public int getAccessMode()- Specified by:
getAccessModein interfaceDiskManagerFileInfo
-
getDownloaded
public long getDownloaded()- Specified by:
getDownloadedin interfaceDiskManagerFileInfo
-
getLastModified
public long getLastModified()- Specified by:
getLastModifiedin interfaceDiskManagerFileInfo
-
getExtension
- Specified by:
getExtensionin interfaceDiskManagerFileInfo
-
getFirstPieceNumber
public int getFirstPieceNumber()- Specified by:
getFirstPieceNumberin interfaceDiskManagerFileInfo
-
getLastPieceNumber
public int getLastPieceNumber()- Specified by:
getLastPieceNumberin interfaceDiskManagerFileInfo
-
getLength
public long getLength()- Specified by:
getLengthin interfaceDiskManagerFileInfo
-
getNbPieces
public int getNbPieces()- Specified by:
getNbPiecesin interfaceDiskManagerFileInfo
-
getPriority
public int getPriority()Description copied from interface:DiskManagerFileInfoFile Download Priority- Specified by:
getPriorityin interfaceDiskManagerFileInfo- Returns:
- Common:
-1: Low
0: Normal
1: High
Not Common:
invalid input: '<'-1: Lower and Lower
>0: Higher and Higher
-
isSkipped
public boolean isSkipped()Description copied from interface:DiskManagerFileInfoSkipped files don't get downloaded. The state of the existing data is dependent uponDiskManagerFileInfo.getStorageType(). StatesDiskManagerFileInfo.ST_COMPACTandDiskManagerFileInfo.ST_REORDER_COMPACTwill delete (or trim) the file. Other states will retain existing data (ie. Do Not Download).- Specified by:
isSkippedin interfaceDiskManagerFileInfo
-
exists
public boolean exists()Description copied from interface:DiskManagerFileInfoChecks that the linked file exists (always returns true for pad files)- Specified by:
existsin interfaceDiskManagerFileInfo- Returns:
-
getIndex
public int getIndex()- Specified by:
getIndexin interfaceDiskManagerFileInfo
-
getDiskManager
- Specified by:
getDiskManagerin interfaceDiskManagerFileInfo
-
getDownloadManager
- Specified by:
getDownloadManagerin interfaceDiskManagerFileInfo
-
getFile
- Specified by:
getFilein interfaceDiskManagerFileInfo
-
getTorrentFile
- Specified by:
getTorrentFilein interfaceDiskManagerFileInfo
-
flushCache
- Specified by:
flushCachein interfaceDiskManagerFileInfo- Throws:
Exception
-
read
- Specified by:
readin interfaceDiskManagerFileInfo- Throws:
IOException
-
getReadBytesPerSecond
public int getReadBytesPerSecond()- Specified by:
getReadBytesPerSecondin interfaceDiskManagerFileInfo
-
getWriteBytesPerSecond
public int getWriteBytesPerSecond()- Specified by:
getWriteBytesPerSecondin interfaceDiskManagerFileInfo
-
getETA
public long getETA()- Specified by:
getETAin interfaceDiskManagerFileInfo
-
recheck
public void recheck()- Specified by:
recheckin interfaceDiskManagerFileInfo
-
close
public void close()- Specified by:
closein interfaceDiskManagerFileInfo
-
addListener
- Specified by:
addListenerin interfaceDiskManagerFileInfo
-
removeListener
- Specified by:
removeListenerin interfaceDiskManagerFileInfo
-