Package com.biglybt.core.download
Class DiskManagerFileInfoDelegate
java.lang.Object
com.biglybt.core.download.DiskManagerFileInfoDelegate
- All Implemented Interfaces:
DiskManagerFileInfo
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsFields inherited from interface com.biglybt.pif.disk.DiskManagerFileInfo
PRIORITY_HIGH, PRIORITY_LOW, PRIORITY_NORMAL, READ, WRITE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateRandomReadRequest
(long file_offset, long length, boolean reverse_order, DiskManagerListener listener) Creates a random read request - these will be executed against the download sequentiallyint
long
byte[]
getFile()
getFile
(boolean follow_link) returns liked file if it exists, direct otherwiseint
int
getIndex()
long
long
Size when file is completegetLink()
int
int
long
boolean
boolean
boolean
void
setDeleted
(boolean b) Mark the file as deleted or not (deleted means the file will be truncated to take up minimum space).void
void
setNumericPriority
(int priority) Sets the file's download priority base on a numbervoid
setPriority
(boolean b) void
setSkipped
(boolean b) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.biglybt.pif.disk.DiskManagerFileInfo
setLink
-
Field Details
-
delegate
DiskManagerFileInfo delegate -
hash
private byte[] hash
-
-
Constructor Details
-
DiskManagerFileInfoDelegate
- Throws:
DownloadException
-
-
Method Details
-
setPriority
public void setPriority(boolean b) - Specified by:
setPriority
in interfaceDiskManagerFileInfo
-
getNumericPriority
public int getNumericPriority()- Specified by:
getNumericPriority
in interfaceDiskManagerFileInfo
- Returns:
-
setNumericPriority
public void setNumericPriority(int priority) Description copied from interface:DiskManagerFileInfo
Sets the file's download priority base on a number- Specified by:
setNumericPriority
in interfaceDiskManagerFileInfo
- Parameters:
priority
- Any number orDiskManagerFileInfo.PRIORITY_LOW
,DiskManagerFileInfo.PRIORITY_NORMAL
,DiskManagerFileInfo.PRIORITY_HIGH
-
setSkipped
public void setSkipped(boolean b) - Specified by:
setSkipped
in interfaceDiskManagerFileInfo
-
isSkipping
- Specified by:
isSkipping
in interfaceDiskManagerFileInfo
-
setDeleted
public void setDeleted(boolean b) Description copied from interface:DiskManagerFileInfo
Mark the file as deleted or not (deleted means the file will be truncated to take up minimum space). This is generally 0 invalid input: '<'= X invalid input: '<' 2*piece_length as pieces can span file boundaries.- Specified by:
setDeleted
in interfaceDiskManagerFileInfo
- Parameters:
b
-
-
setLink
- Specified by:
setLink
in interfaceDiskManagerFileInfo
-
getLink
- Specified by:
getLink
in interfaceDiskManagerFileInfo
-
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
-
getLength
public long getLength()Description copied from interface:DiskManagerFileInfo
Size when file is complete- Specified by:
getLength
in interfaceDiskManagerFileInfo
-
getFile
- Specified by:
getFile
in interfaceDiskManagerFileInfo
-
getFile
Description copied from interface:DiskManagerFileInfo
returns liked file if it exists, direct otherwise- Specified by:
getFile
in interfaceDiskManagerFileInfo
- Parameters:
follow_link
-- Returns:
-
getIndex
public int getIndex()- Specified by:
getIndex
in interfaceDiskManagerFileInfo
-
getFirstPieceNumber
public int getFirstPieceNumber()- Specified by:
getFirstPieceNumber
in interfaceDiskManagerFileInfo
-
getPieceSize
public long getPieceSize()- Specified by:
getPieceSize
in interfaceDiskManagerFileInfo
-
getNumPieces
public int getNumPieces()- Specified by:
getNumPieces
in interfaceDiskManagerFileInfo
-
isPriority
public boolean isPriority()- Specified by:
isPriority
in interfaceDiskManagerFileInfo
-
isSkipped
public boolean isSkipped()- Specified by:
isSkipped
in interfaceDiskManagerFileInfo
-
isDeleted
public boolean isDeleted()- Specified by:
isDeleted
in interfaceDiskManagerFileInfo
-
getDownloadHash
public byte[] getDownloadHash()- Specified by:
getDownloadHash
in interfaceDiskManagerFileInfo
-
getDownload
- Specified by:
getDownload
in interfaceDiskManagerFileInfo
- Throws:
DownloadException
-
createChannel
- Specified by:
createChannel
in interfaceDiskManagerFileInfo
- Throws:
DownloadException
-
createRandomReadRequest
public DiskManagerRandomReadRequest createRandomReadRequest(long file_offset, long length, boolean reverse_order, DiskManagerListener listener) throws DownloadException Description copied from interface:DiskManagerFileInfo
Creates a random read request - these will be executed against the download sequentially- Specified by:
createRandomReadRequest
in interfaceDiskManagerFileInfo
- Parameters:
file_offset
-length
-reverse_order
- - deliver blocks to the listener in reverse orderlistener
-- Returns:
- Throws:
DownloadException
-