Package com.biglybt.pifimpl.remote.disk
Class RPDiskManagerFileInfo
- java.lang.Object
-
- com.biglybt.pifimpl.remote.RPObject
-
- com.biglybt.pifimpl.remote.disk.RPDiskManagerFileInfo
-
- All Implemented Interfaces:
DiskManagerFileInfo
,java.io.Serializable
public class RPDiskManagerFileInfo extends RPObject implements DiskManagerFileInfo
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description int
access_mode
protected DiskManagerFileInfo
delegate
long
downloaded
java.io.File
file
int
first_piece_number
boolean
is_priority
boolean
is_skipped
long
length
int
num_pieces
-
Fields inherited from class com.biglybt.pifimpl.remote.RPObject
__delegate, _dispatcher, _object_id, next_key, object_registry, object_registry_reverse
-
Fields inherited from interface com.biglybt.pif.disk.DiskManagerFileInfo
PRIORITY_HIGH, PRIORITY_LOW, PRIORITY_NORMAL, READ, WRITE
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
RPDiskManagerFileInfo(DiskManagerFileInfo _delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description RPReply
_process(RPRequest request)
protected void
_setDelegate(java.lang.Object _delegate)
java.lang.Object
_setLocal()
static RPDiskManagerFileInfo
create(DiskManagerFileInfo _delegate)
DiskManagerChannel
createChannel()
DiskManagerRandomReadRequest
createRandomReadRequest(long file_offset, long length, boolean reverse_order, DiskManagerListener listener)
Creates a random read request - these will be executed against the download sequentiallyint
getAccessMode()
Download
getDownload()
long
getDownloaded()
byte[]
getDownloadHash()
java.io.File
getFile()
java.io.File
getFile(boolean follow_link)
returns liked file if it exists, direct otherwiseint
getFirstPieceNumber()
int
getIndex()
long
getLastModified()
long
getLength()
Size when file is completejava.io.File
getLink()
int
getNumericPriority()
int
getNumPieces()
long
getPieceSize()
boolean
isDeleted()
boolean
isPriority()
boolean
isSkipped()
void
setDeleted(boolean b)
Mark the file as deleted or not (deleted means the file will be truncated to take up minimum space).void
setLink(java.io.File link_destination)
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 com.biglybt.pifimpl.remote.RPObject
_fixupLocal, _getDelegate, _getName, _getOID, _lookupLocal, _lookupLocal, _refresh, _setRemote, getDispatcher, notSupported, notSupported
-
-
-
-
Field Detail
-
delegate
protected transient DiskManagerFileInfo delegate
-
access_mode
public int access_mode
-
downloaded
public long downloaded
-
length
public long length
-
file
public java.io.File file
-
first_piece_number
public int first_piece_number
-
num_pieces
public int num_pieces
-
is_priority
public boolean is_priority
-
is_skipped
public boolean is_skipped
-
-
Constructor Detail
-
RPDiskManagerFileInfo
protected RPDiskManagerFileInfo(DiskManagerFileInfo _delegate)
-
-
Method Detail
-
create
public static RPDiskManagerFileInfo create(DiskManagerFileInfo _delegate)
-
_setDelegate
protected void _setDelegate(java.lang.Object _delegate)
- Overrides:
_setDelegate
in classRPObject
-
_setLocal
public java.lang.Object _setLocal() throws RPException
- Overrides:
_setLocal
in classRPObject
- Throws:
RPException
-
setPriority
public void setPriority(boolean b)
- Specified by:
setPriority
in interfaceDiskManagerFileInfo
-
setSkipped
public void setSkipped(boolean b)
- Specified by:
setSkipped
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
-
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 <= X < 2*piece_length as pieces can span file boundaries.- Specified by:
setDeleted
in interfaceDiskManagerFileInfo
-
isDeleted
public boolean isDeleted()
- Specified by:
isDeleted
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
public java.io.File getFile()
- Specified by:
getFile
in interfaceDiskManagerFileInfo
-
getFile
public java.io.File getFile(boolean follow_link)
Description copied from interface:DiskManagerFileInfo
returns liked file if it exists, direct otherwise- Specified by:
getFile
in interfaceDiskManagerFileInfo
- Returns:
-
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
-
getIndex
public int getIndex()
- Specified by:
getIndex
in interfaceDiskManagerFileInfo
-
setLink
public void setLink(java.io.File link_destination)
- Specified by:
setLink
in interfaceDiskManagerFileInfo
-
getLink
public java.io.File getLink()
- Specified by:
getLink
in interfaceDiskManagerFileInfo
-
getDownloadHash
public byte[] getDownloadHash()
- Specified by:
getDownloadHash
in interfaceDiskManagerFileInfo
-
getDownload
public Download getDownload() throws DownloadException
- Specified by:
getDownload
in interfaceDiskManagerFileInfo
- Throws:
DownloadException
-
createChannel
public DiskManagerChannel createChannel()
- Specified by:
createChannel
in interfaceDiskManagerFileInfo
-
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
reverse_order
- - deliver blocks to the listener in reverse order- Returns:
- Throws:
DownloadException
-
-