Class RPTorrent
java.lang.Object
com.biglybt.pifimpl.remote.RPObject
com.biglybt.pifimpl.remote.torrent.RPTorrent
- All Implemented Interfaces:
Torrent
,Serializable
- See Also:
-
Field Summary
FieldsFields inherited from class com.biglybt.pifimpl.remote.RPObject
__delegate, _dispatcher, _object_id, next_key, object_registry, object_registry_reverse
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
_setDelegate
(Object _delegate) static RPTorrent
getAdditionalProperty
(String name) Access to top-level properties in the torrentget the announce list for multi-tracker torrents.getClone()
long
UNIX epoch format in secondsgetFiles()
byte[]
getHash()
v1 torrent hash or truncated v2 hash if v2 onlyGets the magnet URI for the torrent - throws exception if not availablegetMapProperty
(String name) Gets a previously set map valuegetName()
long
byte[][]
long
Get a property specific to this pluginlong
getSize()
If size is 0 then this is an "external" torrent and we only know its hash (and name constructed from hash).boolean
boolean
A decentralised torrent uses the DHT only as a "tracker"boolean
Decentralised backup permits the DHT to be used as a tracker when the "real" tracker is unavailableboolean
boolean
A private torrent is either explicitly private via info/private or has decentralised backup disabled and peer exchange disabledboolean
Returns true if the torrent is a single file torrent, false if it is a multi file torrent.Removal all non-standard properties (excluding plugin-properties below)void
save()
Saves the torrent to its persistent locationvoid
setAnnounceURL
(URL url) void
setComment
(String comment) void
setComplete
(File data_dir) sets the torrent complete - i.e.void
setDecentralisedBackupRequested
(boolean requested) By default torrents with OK trackers are not tracked in the DHT.void
void
setEncoding
(String encoding) void
setMapProperty
(String name, Map value) Sets a map property in the torrent, retrievable via getMapPropertyvoid
setPluginStringProperty
(String name, String value) Set a property specific to this pluginvoid
setPrivate
(boolean priv) boolean
byte[]
void
writeToFile
(File file) Methods inherited from class com.biglybt.pifimpl.remote.RPObject
_fixupLocal, _getDelegate, _getName, _getOID, _lookupLocal, _lookupLocal, _refresh, _setRemote, getDispatcher, notSupported, notSupported
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.torrent.Torrent
getFullHash
-
Field Details
-
delegate
-
name
-
size
public long size -
hash
public byte[] hash
-
-
Constructor Details
-
RPTorrent
-
-
Method Details
-
create
-
_setDelegate
- Overrides:
_setDelegate
in classRPObject
-
_setLocal
- Overrides:
_setLocal
in classRPObject
- Throws:
RPException
-
_process
-
getName
-
getAnnounceURL
- Specified by:
getAnnounceURL
in interfaceTorrent
-
setAnnounceURL
- Specified by:
setAnnounceURL
in interfaceTorrent
-
getAnnounceURLList
Description copied from interface:Torrent
get the announce list for multi-tracker torrents. Will always be present but may contain 0 sets which means that this is not a multi-tracker torrent- Specified by:
getAnnounceURLList
in interfaceTorrent
- Returns:
-
isDecentralised
public boolean isDecentralised()Description copied from interface:Torrent
A decentralised torrent uses the DHT only as a "tracker"- Specified by:
isDecentralised
in interfaceTorrent
- Returns:
-
isDecentralisedBackupEnabled
public boolean isDecentralisedBackupEnabled()Description copied from interface:Torrent
Decentralised backup permits the DHT to be used as a tracker when the "real" tracker is unavailable- Specified by:
isDecentralisedBackupEnabled
in interfaceTorrent
- Returns:
-
setDecentralisedBackupRequested
public void setDecentralisedBackupRequested(boolean requested) Description copied from interface:Torrent
By default torrents with OK trackers are not tracked in the DHT. This allows a specific torrent to be marked so that it will be- Specified by:
setDecentralisedBackupRequested
in interfaceTorrent
- Parameters:
requested
-
-
isDecentralisedBackupRequested
public boolean isDecentralisedBackupRequested()- Specified by:
isDecentralisedBackupRequested
in interfaceTorrent
-
isPrivate
public boolean isPrivate()Description copied from interface:Torrent
A private torrent is either explicitly private via info/private or has decentralised backup disabled and peer exchange disabled -
wasCreatedByUs
public boolean wasCreatedByUs()- Specified by:
wasCreatedByUs
in interfaceTorrent
- Returns:
-
setPrivate
public void setPrivate(boolean priv) - Specified by:
setPrivate
in interfaceTorrent
-
getHash
public byte[] getHash()Description copied from interface:Torrent
v1 torrent hash or truncated v2 hash if v2 only -
getSize
public long getSize()Description copied from interface:Torrent
If size is 0 then this is an "external" torrent and we only know its hash (and name constructed from hash). e.g. we don't know file details -
getComment
- Specified by:
getComment
in interfaceTorrent
-
setComment
- Specified by:
setComment
in interfaceTorrent
-
getCreationDate
public long getCreationDate()Description copied from interface:Torrent
UNIX epoch format in seconds- Specified by:
getCreationDate
in interfaceTorrent
-
getCreatedBy
- Specified by:
getCreatedBy
in interfaceTorrent
-
getPieceSize
public long getPieceSize()- Specified by:
getPieceSize
in interfaceTorrent
-
getPieceCount
public long getPieceCount()- Specified by:
getPieceCount
in interfaceTorrent
-
getPieces
public byte[][] getPieces() -
getMagnetURI
Description copied from interface:Torrent
Gets the magnet URI for the torrent - throws exception if not available- Specified by:
getMagnetURI
in interfaceTorrent
- Returns:
-
getEncoding
- Specified by:
getEncoding
in interfaceTorrent
-
setEncoding
- Specified by:
setEncoding
in interfaceTorrent
-
setDefaultEncoding
public void setDefaultEncoding()- Specified by:
setDefaultEncoding
in interfaceTorrent
-
getFiles
-
getAdditionalProperty
Description copied from interface:Torrent
Access to top-level properties in the torrent- Specified by:
getAdditionalProperty
in interfaceTorrent
- Parameters:
name
-- Returns:
-
removeAdditionalProperties
Description copied from interface:Torrent
Removal all non-standard properties (excluding plugin-properties below)- Specified by:
removeAdditionalProperties
in interfaceTorrent
- Returns:
-
setPluginStringProperty
Description copied from interface:Torrent
Set a property specific to this plugin- Specified by:
setPluginStringProperty
in interfaceTorrent
- Parameters:
name
-value
-
-
getPluginStringProperty
Description copied from interface:Torrent
Get a property specific to this plugin- Specified by:
getPluginStringProperty
in interfaceTorrent
- Parameters:
name
-- Returns:
-
setMapProperty
Description copied from interface:Torrent
Sets a map property in the torrent, retrievable via getMapProperty- Specified by:
setMapProperty
in interfaceTorrent
- Parameters:
name
- should be unique across plugins (i.e. prefix it with something unique)value
- bencodable Map value
-
getMapProperty
Description copied from interface:Torrent
Gets a previously set map value- Specified by:
getMapProperty
in interfaceTorrent
- Parameters:
name
- should be unique across plugins (i.e. prefix it with something unique)- Returns:
- See Also:
-
writeToMap
- Specified by:
writeToMap
in interfaceTorrent
- Throws:
TorrentException
-
writeToBEncodedData
- Specified by:
writeToBEncodedData
in interfaceTorrent
- Throws:
TorrentException
-
writeToFile
- Specified by:
writeToFile
in interfaceTorrent
- Throws:
TorrentException
-
save
Description copied from interface:Torrent
Saves the torrent to its persistent location- Specified by:
save
in interfaceTorrent
- Throws:
TorrentException
-
setComplete
Description copied from interface:Torrent
sets the torrent complete - i.e. ready for seeding. Doing this avoids a recheck on torrent addition- Specified by:
setComplete
in interfaceTorrent
- Parameters:
data_dir
-- Throws:
TorrentException
-
isComplete
public boolean isComplete()- Specified by:
isComplete
in interfaceTorrent
-
isSimpleTorrent
public boolean isSimpleTorrent()Description copied from interface:Torrent
Returns true if the torrent is a single file torrent, false if it is a multi file torrent.- Specified by:
isSimpleTorrent
in interfaceTorrent
-
getClone
- Specified by:
getClone
in interfaceTorrent
- Throws:
TorrentException
-