|
|||||||||
| 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.core3.util.TorrentUtils.torrentDelegate
public static class TorrentUtils.torrentDelegate
| Field Summary |
|---|
| Fields inherited from interface org.gudy.azureus2.core3.torrent.TOTorrent |
|---|
AZUREUS_PRIVATE_PROPERTIES, AZUREUS_PROPERTIES, DEFAULT_IGNORE_FILES, ENCODING_ACTUALLY_UTF8_KEYS |
| Constructor Summary | |
|---|---|
protected |
TorrentUtils.torrentDelegate(TOTorrent _delegate,
java.io.File _file)
|
| Method Summary | |
|---|---|
void |
addListener(TOTorrentListener l)
|
protected void |
discardPieces(long now,
boolean force)
|
byte[] |
getAdditionalByteArrayProperty(java.lang.String name)
|
java.util.List |
getAdditionalListProperty(java.lang.String name)
|
java.lang.Long |
getAdditionalLongProperty(java.lang.String name)
|
java.util.Map |
getAdditionalMapProperty(java.lang.String name)
|
java.lang.Object |
getAdditionalProperty(java.lang.String name)
|
java.lang.String |
getAdditionalStringProperty(java.lang.String name)
|
java.net.URL |
getAnnounceURL()
A torrent must have a URL that identifies the tracker. |
TOTorrentAnnounceURLGroup |
getAnnounceURLGroup()
When a group of sets of trackers is defined their URLs are accessed via this method |
TOTorrentAnnounceURLGroup |
getAnnounceURLGroupSupport()
|
java.net.URL |
getAnnounceURLSupport()
|
byte[] |
getComment()
Comment is an optional torrent property |
byte[] |
getCreatedBy()
|
long |
getCreationDate()
Gets the creation date of the torrent. |
int |
getFileCount()
|
TOTorrentFile[] |
getFiles()
A torrent consists of one or more files. |
byte[] |
getHash()
A torrent has a unique SHA1 (20 byte) hash that is computed from some of its contents. |
HashWrapper |
getHashWrapper()
convenience method to get a wrapped hash for performance purposes |
AEMonitor |
getMonitor()
|
byte[] |
getName()
Get the name of the torrent |
int |
getNumberOfPieces()
|
long |
getPieceLength()
Returns the piece length used for the torrent |
byte[][] |
getPieces()
|
boolean |
getPrivate()
|
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()
|
java.lang.String |
getUTF8Name()
Retrieves the utf8 name of the torrent ONLY if the torrent specified one in it's info map. |
boolean |
hasSameHashAs(TOTorrent other)
compares two torrents by hash |
boolean |
isCreated()
|
boolean |
isDecentralised()
This method provides access to the SHA1 hash values (20 bytes each) that correspond to the pieces of the torrent. |
boolean |
isSimpleTorrent()
A "simple torrent" is one that consists of a single file on its own (i.e. |
byte[][] |
peekPieces()
peeks the pieces, will return null if they are discarded |
void |
print()
A diagnostic method for dumping the tracker contents to "stdout" |
void |
removeAdditionalProperties()
remove all additional properties to clear out the torrent |
void |
removeAdditionalProperty(java.lang.String name)
|
void |
removeListener(TOTorrentListener l)
|
protected boolean[] |
restoreState(boolean do_pieces,
boolean do_fluff)
monitor must be held before calling me |
void |
serialiseToBEncodedFile(java.io.File target_file)
This method will serialise a torrent using the standard "b-encoding" mechanism into a file |
java.util.Map |
serialiseToMap()
This method will serialise a torrent into a Map consistent with that used by the "b-encoding" routines defined elsewhere |
void |
serialiseToXMLFile(java.io.File target_file)
This method will serialise a torrent using an XML encoding to a file |
void |
setAdditionalByteArrayProperty(java.lang.String name,
byte[] value)
|
void |
setAdditionalListProperty(java.lang.String name,
java.util.List value)
|
void |
setAdditionalLongProperty(java.lang.String name,
java.lang.Long value)
|
void |
setAdditionalMapProperty(java.lang.String name,
java.util.Map value)
|
void |
setAdditionalProperty(java.lang.String name,
java.lang.Object value)
set an arbitrary property. |
void |
setAdditionalStringProperty(java.lang.String name,
java.lang.String value)
The additional properties are used for holding non-core data for Azureus' own user |
boolean |
setAnnounceURL(java.net.URL url)
|
void |
setComment(java.lang.String comment)
|
void |
setCreatedBy(byte[] cb)
|
void |
setCreationDate(long date)
|
void |
setDiscardFluff(boolean discard)
|
void |
setHashOverride(byte[] hash)
Only supported for decentralised torrents, allows an alternative hash to be used for them in the DHT |
void |
setPieces(byte[][] pieces)
This method exists to support the temporary discarding of piece hashes to conserver memory. |
void |
setPrivate(boolean _private)
Note - changing the private attribute CHANGES THE TORRENT HASH |
| 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 |
|---|
protected TorrentUtils.torrentDelegate(TOTorrent _delegate,
java.io.File _file)
| Method Detail |
|---|
public void setDiscardFluff(boolean discard)
setDiscardFluff in interface TorrentUtils.ExtendedTorrentpublic byte[] getName()
TOTorrent
getName in interface TOTorrentpublic boolean isSimpleTorrent()
TOTorrent
isSimpleTorrent in interface TOTorrentpublic byte[] getComment()
TOTorrent
getComment in interface TOTorrentpublic void setComment(java.lang.String comment)
setComment in interface TOTorrentpublic long getCreationDate()
TOTorrent
getCreationDate in interface TOTorrentpublic void setCreationDate(long date)
setCreationDate in interface TOTorrentpublic byte[] getCreatedBy()
getCreatedBy in interface TOTorrentpublic void setCreatedBy(byte[] cb)
setCreatedBy in interface TOTorrentpublic boolean isCreated()
isCreated in interface TOTorrentpublic boolean isDecentralised()
TOTorrent
isDecentralised in interface TOTorrentpublic java.net.URL getAnnounceURL()
TOTorrent
getAnnounceURL in interface TOTorrentpublic TOTorrentAnnounceURLGroup getAnnounceURLGroup()
TOTorrent
getAnnounceURLGroup in interface TOTorrentpublic java.net.URL getAnnounceURLSupport()
public boolean setAnnounceURL(java.net.URL url)
setAnnounceURL in interface TOTorrentpublic TOTorrentAnnounceURLGroup getAnnounceURLGroupSupport()
protected void discardPieces(long now,
boolean force)
public byte[][] getPieces()
throws TOTorrentException
getPieces in interface TOTorrentTOTorrentException
protected boolean[] restoreState(boolean do_pieces,
boolean do_fluff)
throws TOTorrentException
do_pieces - do_fluff -
TOTorrentException
public byte[][] peekPieces()
throws TOTorrentException
peekPieces in interface TorrentUtils.ExtendedTorrentTOTorrentException
public void setPieces(byte[][] pieces)
throws TOTorrentException
TOTorrent
setPieces in interface TOTorrentTOTorrentExceptionpublic long getPieceLength()
TOTorrent
getPieceLength in interface TOTorrentpublic int getNumberOfPieces()
getNumberOfPieces in interface TOTorrentpublic long getSize()
getSize in interface TOTorrentpublic int getFileCount()
getFileCount in interface TOTorrentpublic TOTorrentFile[] getFiles()
TOTorrent
getFiles in interface TOTorrent
public byte[] getHash()
throws TOTorrentException
TOTorrent
getHash in interface TOTorrentTOTorrentException
public HashWrapper getHashWrapper()
throws TOTorrentException
TOTorrent
getHashWrapper in interface TOTorrentTOTorrentException
public void setHashOverride(byte[] hash)
throws TOTorrentException
TOTorrent
setHashOverride in interface TOTorrentTOTorrentExceptionpublic boolean getPrivate()
getPrivate in interface TOTorrent
public void setPrivate(boolean _private)
throws TOTorrentException
TOTorrent
setPrivate in interface TOTorrentTOTorrentExceptionpublic boolean hasSameHashAs(TOTorrent other)
TOTorrent
hasSameHashAs in interface TOTorrent
public void setAdditionalStringProperty(java.lang.String name,
java.lang.String value)
TOTorrent
setAdditionalStringProperty in interface TOTorrentname - name of the property (e.g. "encoding")value - value. This will be encoded with default encodingpublic java.lang.String getAdditionalStringProperty(java.lang.String name)
getAdditionalStringProperty in interface TOTorrent
public void setAdditionalByteArrayProperty(java.lang.String name,
byte[] value)
setAdditionalByteArrayProperty in interface TOTorrentpublic byte[] getAdditionalByteArrayProperty(java.lang.String name)
getAdditionalByteArrayProperty in interface TOTorrent
public void setAdditionalLongProperty(java.lang.String name,
java.lang.Long value)
setAdditionalLongProperty in interface TOTorrentpublic java.lang.Long getAdditionalLongProperty(java.lang.String name)
getAdditionalLongProperty in interface TOTorrent
public void setAdditionalListProperty(java.lang.String name,
java.util.List value)
setAdditionalListProperty in interface TOTorrentpublic java.util.List getAdditionalListProperty(java.lang.String name)
getAdditionalListProperty in interface TOTorrent
public void setAdditionalMapProperty(java.lang.String name,
java.util.Map value)
setAdditionalMapProperty in interface TOTorrentpublic java.util.Map getAdditionalMapProperty(java.lang.String name)
getAdditionalMapProperty in interface TOTorrentpublic java.lang.Object getAdditionalProperty(java.lang.String name)
getAdditionalProperty in interface TOTorrent
public void setAdditionalProperty(java.lang.String name,
java.lang.Object value)
TOTorrent
setAdditionalProperty in interface TOTorrentpublic void removeAdditionalProperty(java.lang.String name)
removeAdditionalProperty in interface TOTorrentpublic void removeAdditionalProperties()
TOTorrent
removeAdditionalProperties in interface TOTorrent
public void serialiseToBEncodedFile(java.io.File target_file)
throws TOTorrentException
TOTorrent
serialiseToBEncodedFile in interface TOTorrentTOTorrentException
public java.util.Map serialiseToMap()
throws TOTorrentException
TOTorrent
serialiseToMap in interface TOTorrentTOTorrentException
public void serialiseToXMLFile(java.io.File target_file)
throws TOTorrentException
TOTorrent
serialiseToXMLFile in interface TOTorrentTOTorrentExceptionpublic void addListener(TOTorrentListener l)
addListener in interface TOTorrentpublic void removeListener(TOTorrentListener l)
removeListener in interface TOTorrentpublic AEMonitor getMonitor()
getMonitor in interface TOTorrentpublic void print()
TOTorrent
print in interface TOTorrentpublic java.lang.String getRelationText()
LogRelation
getRelationText in class LogRelationpublic java.lang.Object[] getQueryableInterfaces()
LogRelation
getQueryableInterfaces in class LogRelationpublic java.lang.String getUTF8Name()
TOTorrent
getUTF8Name in interface TOTorrent
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||