|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gudy.azureus2.core3.logging.LogRelation
org.gudy.azureus2.pluginsimpl.local.torrent.TorrentImpl
public class TorrentImpl
Constructor Summary | |
---|---|
TorrentImpl(PluginInterface _pi,
TOTorrent _torrent)
|
|
TorrentImpl(TOTorrent _torrent)
|
Method Summary | |
---|---|
protected java.lang.String |
decode(byte[] data)
|
java.lang.Object |
getAdditionalProperty(java.lang.String name)
Access to top-level properties in the torrent |
java.net.URL |
getAnnounceURL()
|
TorrentAnnounceURLList |
getAnnounceURLList()
get the announce list for multi-tracker torrents. |
Torrent |
getClone()
|
java.lang.String |
getComment()
|
java.lang.String |
getCreatedBy()
|
long |
getCreationDate()
UNIX epoch format in seconds |
protected void |
getDecoder()
|
java.lang.String |
getEncoding()
|
TorrentFile[] |
getFiles()
|
byte[] |
getHash()
|
java.net.URL |
getMagnetURI()
Gets the magnet URI for the torrent - throws exception if not available |
java.util.Map |
getMapProperty(java.lang.String name)
Gets a previously set map value |
java.lang.String |
getName()
|
long |
getPieceCount()
|
byte[][] |
getPieces()
|
long |
getPieceSize()
|
java.lang.String |
getPluginStringProperty(java.lang.String name)
Get a property specific to this plugin |
java.lang.Object[] |
getQueryableInterfaces()
Query this class for a reference to another class that it may hold |
java.lang.String |
getRelationText()
A short description of what your class holds that can be printed by the logger |
long |
getSize()
If size is 0 then this is an "external" torrent and we only know its hash (and name constructed from hash). |
TOTorrent |
getTorrent()
|
boolean |
isComplete()
|
boolean |
isDecentralised()
A decentralised torrent uses the DHT only as a "tracker" |
boolean |
isDecentralisedBackupEnabled()
Decentralised backup permits the DHT to be used as a tracker when the "real" tracker is unavailable |
boolean |
isDecentralisedBackupRequested()
|
boolean |
isPrivate()
A private torrent is either explicitly private via info/private or has decentralised backup disabled and peer exchange disabled |
boolean |
isSimpleTorrent()
Returns true if the torrent is a single file torrent, false if it is a multi file torrent. |
Torrent |
removeAdditionalProperties()
Removal all non-standard properties (excluding plugin-properties below) |
void |
save()
Saves the torrent to its persistent location |
void |
setAnnounceURL(java.net.URL url)
|
void |
setComment(java.lang.String comment)
|
void |
setComplete(java.io.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 |
setDefaultEncoding()
|
void |
setEncoding(java.lang.String encoding)
|
void |
setMapProperty(java.lang.String name,
java.util.Map value)
Sets a map property in the torrent, retrievable via getMapProperty |
void |
setPluginStringProperty(java.lang.String name,
java.lang.String value)
Set a property specific to this plugin |
void |
setPrivate(boolean priv)
|
protected void |
updated()
|
boolean |
wasCreatedByUs()
|
byte[] |
writeToBEncodedData()
|
void |
writeToFile(java.io.File file)
|
java.util.Map |
writeToMap()
|
Methods inherited from class org.gudy.azureus2.core3.logging.LogRelation |
---|
propogatedRelationText, queryForClass, queryForClass |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TorrentImpl(TOTorrent _torrent)
public TorrentImpl(PluginInterface _pi, TOTorrent _torrent)
Method Detail |
---|
public java.lang.String getName()
getName
in interface Torrent
public java.net.URL getAnnounceURL()
getAnnounceURL
in interface Torrent
public void setAnnounceURL(java.net.URL url)
setAnnounceURL
in interface Torrent
public TorrentAnnounceURLList getAnnounceURLList()
Torrent
getAnnounceURLList
in interface Torrent
public TOTorrent getTorrent()
public boolean isDecentralised()
Torrent
isDecentralised
in interface Torrent
public boolean isDecentralisedBackupEnabled()
Torrent
isDecentralisedBackupEnabled
in interface Torrent
public void setDecentralisedBackupRequested(boolean requested)
Torrent
setDecentralisedBackupRequested
in interface Torrent
public boolean isDecentralisedBackupRequested()
isDecentralisedBackupRequested
in interface Torrent
public boolean isPrivate()
Torrent
isPrivate
in interface Torrent
public void setPrivate(boolean priv)
setPrivate
in interface Torrent
public boolean wasCreatedByUs()
wasCreatedByUs
in interface Torrent
public java.net.URL getMagnetURI() throws TorrentException
Torrent
getMagnetURI
in interface Torrent
TorrentException
public byte[] getHash()
getHash
in interface Torrent
public long getSize()
Torrent
getSize
in interface Torrent
public java.lang.String getComment()
getComment
in interface Torrent
public void setComment(java.lang.String comment)
setComment
in interface Torrent
public long getCreationDate()
Torrent
getCreationDate
in interface Torrent
public java.lang.String getCreatedBy()
getCreatedBy
in interface Torrent
public long getPieceSize()
getPieceSize
in interface Torrent
public long getPieceCount()
getPieceCount
in interface Torrent
public byte[][] getPieces()
getPieces
in interface Torrent
public TorrentFile[] getFiles()
getFiles
in interface Torrent
protected void getDecoder()
public java.lang.String getEncoding()
getEncoding
in interface Torrent
public void setEncoding(java.lang.String encoding) throws TorrentEncodingException
setEncoding
in interface Torrent
TorrentEncodingException
public void setDefaultEncoding() throws TorrentEncodingException
setDefaultEncoding
in interface Torrent
TorrentEncodingException
protected java.lang.String decode(byte[] data)
public java.lang.Object getAdditionalProperty(java.lang.String name)
Torrent
getAdditionalProperty
in interface Torrent
public Torrent removeAdditionalProperties()
Torrent
removeAdditionalProperties
in interface Torrent
public void setPluginStringProperty(java.lang.String name, java.lang.String value)
Torrent
setPluginStringProperty
in interface Torrent
public java.lang.String getPluginStringProperty(java.lang.String name)
Torrent
getPluginStringProperty
in interface Torrent
public void setMapProperty(java.lang.String name, java.util.Map value)
Torrent
setMapProperty
in interface Torrent
name
- should be unique across plugins (i.e. prefix it with something unique)value
- bencodable Map valuepublic java.util.Map getMapProperty(java.lang.String name)
Torrent
getMapProperty
in interface Torrent
name
- should be unique across plugins (i.e. prefix it with something unique)
setMapProperty
public java.util.Map writeToMap() throws TorrentException
writeToMap
in interface Torrent
TorrentException
public byte[] writeToBEncodedData() throws TorrentException
writeToBEncodedData
in interface Torrent
TorrentException
public void writeToFile(java.io.File file) throws TorrentException
writeToFile
in interface Torrent
TorrentException
protected void updated()
public void save() throws TorrentException
Torrent
save
in interface Torrent
TorrentException
public void setComplete(java.io.File data_dir) throws TorrentException
Torrent
setComplete
in interface Torrent
TorrentException
public boolean isComplete()
isComplete
in interface Torrent
public java.lang.String getRelationText()
LogRelation
getRelationText
in class LogRelation
public java.lang.Object[] getQueryableInterfaces()
LogRelation
getQueryableInterfaces
in class LogRelation
public boolean isSimpleTorrent()
Torrent
isSimpleTorrent
in interface Torrent
public Torrent getClone() throws TorrentException
getClone
in interface Torrent
TorrentException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |