Class RPTorrentManager
- java.lang.Object
-
- com.biglybt.pifimpl.remote.RPObject
-
- com.biglybt.pifimpl.remote.torrent.RPTorrentManager
-
- All Implemented Interfaces:
TorrentManager
,java.io.Serializable
public class RPTorrentManager extends RPObject implements TorrentManager
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected TorrentManager
delegate
-
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.torrent.TorrentManager
PRESERVE_ALL, PRESERVE_ENCODING, PRESERVE_NONE
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
RPTorrentManager(TorrentManager _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()
void
addListener(TorrentManagerListener l)
static RPTorrentManager
create(TorrentManager _delegate)
Torrent
createFromBEncodedData(byte[] data)
decodes a torrent encoded using the normal "bencoding" rules from a byte arrayTorrent
createFromBEncodedData(byte[] data, int preserve)
decodes a torrent encoded using the normal "bencoding" rules from a byte arrayTorrent
createFromBEncodedFile(java.io.File file)
decodes a torrent encoded using the normal "bencoding" rules from a fileTorrent
createFromBEncodedFile(java.io.File file, boolean for_seeding)
decodes a torrent encoded using the normal "bencoding" rules from a file but discards the piece hashes to save memory.Torrent
createFromBEncodedFile(java.io.File file, int preserve)
decodes a torrent encoded using the normal "bencoding" rules from a fileTorrent
createFromBEncodedInputStream(java.io.InputStream data)
decodes a torrent encoded using the normal "bencoding" rules from an InputStreamTorrent
createFromBEncodedInputStream(java.io.InputStream data, int preserve)
decodes a torrent encoded using the normal "bencoding" rules from an InputStreamTorrent
createFromDataFile(java.io.File data, java.net.URL announce_url)
creates a new torrent from an input fileTorrent
createFromDataFile(java.io.File data, java.net.URL announce_url, boolean include_other_hashes)
TorrentCreator
createFromDataFileEx(java.io.File data, java.net.URL announce_url, boolean include_other_hashes)
TorrentAttribute
getAttribute(java.lang.String name)
Gives access to the standard built-in attributesTorrentAttribute[]
getDefinedAttributes()
Gives access to the currently defined torrent attributes.TorrentAttribute
getPluginAttribute(java.lang.String name)
Gives access to/creates arbitrary String attributes for plugins to use.TorrentDownloader
getURLDownloader(java.net.URL url)
TorrentDownloader
getURLDownloader(java.net.URL url, java.lang.String user_name, java.lang.String password)
void
removeListener(TorrentManagerListener l)
-
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 TorrentManager delegate
-
-
Constructor Detail
-
RPTorrentManager
protected RPTorrentManager(TorrentManager _delegate)
-
-
Method Detail
-
create
public static RPTorrentManager create(TorrentManager _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
-
getURLDownloader
public TorrentDownloader getURLDownloader(java.net.URL url) throws TorrentException
- Specified by:
getURLDownloader
in interfaceTorrentManager
- Throws:
TorrentException
-
getURLDownloader
public TorrentDownloader getURLDownloader(java.net.URL url, java.lang.String user_name, java.lang.String password) throws TorrentException
- Specified by:
getURLDownloader
in interfaceTorrentManager
- Throws:
TorrentException
-
createFromBEncodedFile
public Torrent createFromBEncodedFile(java.io.File file) throws TorrentException
Description copied from interface:TorrentManager
decodes a torrent encoded using the normal "bencoding" rules from a file- Specified by:
createFromBEncodedFile
in interfaceTorrentManager
- Returns:
- Throws:
TorrentException
-
createFromBEncodedFile
public Torrent createFromBEncodedFile(java.io.File file, boolean for_seeding) throws TorrentException
Description copied from interface:TorrentManager
decodes a torrent encoded using the normal "bencoding" rules from a file but discards the piece hashes to save memory. note that this means that if something reads the hashes they will be re-read from the torrent file and if the file has since been deleted things go smelly- Specified by:
createFromBEncodedFile
in interfaceTorrentManager
for_seeding
- reduces memory usage by discarding piece hashes- Returns:
- Throws:
TorrentException
-
createFromBEncodedInputStream
public Torrent createFromBEncodedInputStream(java.io.InputStream data) throws TorrentException
Description copied from interface:TorrentManager
decodes a torrent encoded using the normal "bencoding" rules from an InputStream- Specified by:
createFromBEncodedInputStream
in interfaceTorrentManager
- Returns:
- Throws:
TorrentException
-
createFromBEncodedData
public Torrent createFromBEncodedData(byte[] data) throws TorrentException
Description copied from interface:TorrentManager
decodes a torrent encoded using the normal "bencoding" rules from a byte array- Specified by:
createFromBEncodedData
in interfaceTorrentManager
- Returns:
- Throws:
TorrentException
-
createFromBEncodedData
public Torrent createFromBEncodedData(byte[] data, int preserve) throws TorrentException
Description copied from interface:TorrentManager
decodes a torrent encoded using the normal "bencoding" rules from a byte array- Specified by:
createFromBEncodedData
in interfaceTorrentManager
preserve
- PRESERVE_* flags- Returns:
- Throws:
TorrentException
-
createFromBEncodedFile
public Torrent createFromBEncodedFile(java.io.File file, int preserve) throws TorrentException
Description copied from interface:TorrentManager
decodes a torrent encoded using the normal "bencoding" rules from a file- Specified by:
createFromBEncodedFile
in interfaceTorrentManager
preserve
- PRESERVE_* flags- Returns:
- Throws:
TorrentException
-
createFromBEncodedInputStream
public Torrent createFromBEncodedInputStream(java.io.InputStream data, int preserve) throws TorrentException
Description copied from interface:TorrentManager
decodes a torrent encoded using the normal "bencoding" rules from an InputStream- Specified by:
createFromBEncodedInputStream
in interfaceTorrentManager
preserve
- PRESERVE_* flags- Returns:
- Throws:
TorrentException
-
createFromDataFile
public Torrent createFromDataFile(java.io.File data, java.net.URL announce_url) throws TorrentException
Description copied from interface:TorrentManager
creates a new torrent from an input file- Specified by:
createFromDataFile
in interfaceTorrentManager
- Returns:
- Throws:
TorrentException
-
createFromDataFile
public Torrent createFromDataFile(java.io.File data, java.net.URL announce_url, boolean include_other_hashes) throws TorrentException
- Specified by:
createFromDataFile
in interfaceTorrentManager
- Throws:
TorrentException
-
createFromDataFileEx
public TorrentCreator createFromDataFileEx(java.io.File data, java.net.URL announce_url, boolean include_other_hashes) throws TorrentException
- Specified by:
createFromDataFileEx
in interfaceTorrentManager
- Throws:
TorrentException
-
getDefinedAttributes
public TorrentAttribute[] getDefinedAttributes()
Description copied from interface:TorrentManager
Gives access to the currently defined torrent attributes. As of 2.1.0.2 only "category" is defined, however in the future more could be added such as "quality", "bit rate" etc.- Specified by:
getDefinedAttributes
in interfaceTorrentManager
- Returns:
-
getAttribute
public TorrentAttribute getAttribute(java.lang.String name)
Description copied from interface:TorrentManager
Gives access to the standard built-in attributes- Specified by:
getAttribute
in interfaceTorrentManager
- Returns:
-
getPluginAttribute
public TorrentAttribute getPluginAttribute(java.lang.String name)
Description copied from interface:TorrentManager
Gives access to/creates arbitrary String attributes for plugins to use. The attribute will be specific to the plugin, so you can use short torrent names like "name", you won't need to add the plugin ID or any other sort of unique identifier to the attribute name.- Specified by:
getPluginAttribute
in interfaceTorrentManager
- Returns:
-
addListener
public void addListener(TorrentManagerListener l)
- Specified by:
addListener
in interfaceTorrentManager
-
removeListener
public void removeListener(TorrentManagerListener l)
- Specified by:
removeListener
in interfaceTorrentManager
-
-