Package com.biglybt.core.download.impl
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 DiskManagerFileInfo
private List<DiskManagerFileInfoListener>
Fields inherited from interface com.biglybt.core.disk.DiskManagerFileInfo
READ, ST_COMPACT, ST_LINEAR, ST_REORDER, ST_REORDER_COMPACT, WRITE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(DiskManagerFileInfoListener listener) void
close()
boolean
exists()
Checks that the linked file exists (always returns true for pad files)void
int
long
long
getETA()
getFile
(boolean follow_link) int
int
getIndex()
long
int
long
getLink()
int
int
File Download Priorityint
int
Returns the storage type for this fileint
boolean
Skipped files don't get downloaded.read
(long offset, int length) void
recheck()
void
removeListener
(DiskManagerFileInfoListener listener) protected void
setDelegate
(DiskManagerFileInfo new_delegate) boolean
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, boolean no_delete) boolean
setLinkAtomic
(File link_destination, boolean no_delete, FileUtil.ProgressListener pl) void
setPriority
(int b) void
setSkipped
(boolean b) boolean
setStorageType
(int type, boolean force) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.biglybt.core.disk.DiskManagerFileInfo
isLinked, setStorageType
-
Field Details
-
delegate
-
listeners
-
-
Constructor Details
-
fileInfoFacade
protected fileInfoFacade()
-
-
Method Details
-
setDelegate
-
setPriority
public void setPriority(int b) - Specified by:
setPriority
in interfaceDiskManagerFileInfo
-
setSkipped
public void setSkipped(boolean b) - Specified by:
setSkipped
in interfaceDiskManagerFileInfo
-
isSkipping
- Specified by:
isSkipping
in interfaceDiskManagerFileInfo
-
setLink
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 interfaceDiskManagerFileInfo
- Returns:
- true - worked, false - failed, use getLastError to possibly get some extra info
-
getLastError
- Specified by:
getLastError
in interfaceDiskManagerFileInfo
-
setLinkAtomic
- Specified by:
setLinkAtomic
in interfaceDiskManagerFileInfo
-
setLinkAtomic
public boolean setLinkAtomic(File link_destination, boolean no_delete, FileUtil.ProgressListener pl) - Specified by:
setLinkAtomic
in interfaceDiskManagerFileInfo
-
getLink
- Specified by:
getLink
in interfaceDiskManagerFileInfo
-
setStorageType
public boolean setStorageType(int type, boolean force) - Specified by:
setStorageType
in interfaceDiskManagerFileInfo
force
- discards any existing file content if it exists - use with care...- Returns:
-
getStorageType
public int getStorageType()Description copied from interface:DiskManagerFileInfo
Returns the storage type for this file- Specified by:
getStorageType
in interfaceDiskManagerFileInfo
- Returns:
DiskManagerFileInfo.ST_LINEAR
,DiskManagerFileInfo.ST_COMPACT
,DiskManagerFileInfo.ST_REORDER
,DiskManagerFileInfo.ST_REORDER_COMPACT
-
getAccessMode
public int getAccessMode()- Specified by:
getAccessMode
in interfaceDiskManagerFileInfo
-
getDownloaded
public long getDownloaded()- Specified by:
getDownloaded
in interfaceDiskManagerFileInfo
-
getLastModified
public long getLastModified()- Specified by:
getLastModified
in interfaceDiskManagerFileInfo
-
getExtension
- Specified by:
getExtension
in interfaceDiskManagerFileInfo
-
getFirstPieceNumber
public int getFirstPieceNumber()- Specified by:
getFirstPieceNumber
in interfaceDiskManagerFileInfo
-
getLastPieceNumber
public int getLastPieceNumber()- Specified by:
getLastPieceNumber
in interfaceDiskManagerFileInfo
-
getLength
public long getLength()- Specified by:
getLength
in interfaceDiskManagerFileInfo
-
getNbPieces
public int getNbPieces()- Specified by:
getNbPieces
in interfaceDiskManagerFileInfo
-
getPriority
public int getPriority()Description copied from interface:DiskManagerFileInfo
File Download Priority- Specified by:
getPriority
in interfaceDiskManagerFileInfo
- Returns:
- Common:
-1
: Low
0
: Normal
1
: High
Not Common:
<-1
: Lower and Lower
>0
: Higher and Higher
-
isSkipped
public boolean isSkipped()Description copied from interface:DiskManagerFileInfo
Skipped files don't get downloaded. The state of the existing data is dependent uponDiskManagerFileInfo.getStorageType()
. StatesDiskManagerFileInfo.ST_COMPACT
andDiskManagerFileInfo.ST_REORDER_COMPACT
will delete (or trim) the file. Other states will retain existing data (ie. Do Not Download).- Specified by:
isSkipped
in interfaceDiskManagerFileInfo
-
exists
public boolean exists()Description copied from interface:DiskManagerFileInfo
Checks that the linked file exists (always returns true for pad files)- Specified by:
exists
in interfaceDiskManagerFileInfo
- Returns:
-
getIndex
public int getIndex()- Specified by:
getIndex
in interfaceDiskManagerFileInfo
-
getDiskManager
- Specified by:
getDiskManager
in interfaceDiskManagerFileInfo
-
getDownloadManager
- Specified by:
getDownloadManager
in interfaceDiskManagerFileInfo
-
getFile
- Specified by:
getFile
in interfaceDiskManagerFileInfo
-
getTorrentFile
- Specified by:
getTorrentFile
in interfaceDiskManagerFileInfo
-
flushCache
- Specified by:
flushCache
in interfaceDiskManagerFileInfo
- Throws:
Exception
-
read
- Specified by:
read
in interfaceDiskManagerFileInfo
- Throws:
IOException
-
getReadBytesPerSecond
public int getReadBytesPerSecond()- Specified by:
getReadBytesPerSecond
in interfaceDiskManagerFileInfo
-
getWriteBytesPerSecond
public int getWriteBytesPerSecond()- Specified by:
getWriteBytesPerSecond
in interfaceDiskManagerFileInfo
-
getETA
public long getETA()- Specified by:
getETA
in interfaceDiskManagerFileInfo
-
recheck
public void recheck()- Specified by:
recheck
in interfaceDiskManagerFileInfo
-
close
public void close()- Specified by:
close
in interfaceDiskManagerFileInfo
-
addListener
- Specified by:
addListener
in interfaceDiskManagerFileInfo
-
removeListener
- Specified by:
removeListener
in interfaceDiskManagerFileInfo
-