|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.gudy.azureus2.core3.logging.LogRelation org.gudy.azureus2.core3.torrent.impl.TOTorrentImpl
public class TOTorrentImpl
Field Summary | |
---|---|
protected AEMonitor |
this_mon
|
protected static List |
TK_ADDITIONAL_OK_ATTRS
|
protected static String |
TK_ANNOUNCE
|
protected static String |
TK_ANNOUNCE_LIST
|
protected static String |
TK_COMMENT
|
protected static String |
TK_COMMENT_UTF8
|
protected static String |
TK_CREATED_BY
|
protected static String |
TK_CREATION_DATE
|
protected static String |
TK_FILES
|
protected static String |
TK_HASH_OVERRIDE
|
protected static String |
TK_INFO
|
protected static String |
TK_LENGTH
|
protected static String |
TK_NAME
|
protected static String |
TK_NAME_UTF8
|
protected static String |
TK_PATH
|
protected static String |
TK_PATH_UTF8
|
protected static String |
TK_PIECE_LENGTH
|
protected static String |
TK_PIECES
|
protected static String |
TK_PRIVATE
|
protected static String |
TK_WEBSEED_BT
|
protected static String |
TK_WEBSEED_GR
|
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 |
TOTorrentImpl()
Constructor for deserialisation |
protected |
TOTorrentImpl(String _torrent_name,
URL _announce_url,
boolean _simple_torrent)
Constructor for creation |
Method Summary | |
---|---|
protected void |
addAdditionalInfoProperty(String name,
Object value)
|
protected void |
addAdditionalProperty(String name,
Object value)
|
void |
addListener(TOTorrentListener l)
|
protected void |
addTorrentAnnounceURLSet(URL[] urls)
|
protected URL |
anonymityTransform(URL url)
|
protected void |
fireChanged(int type)
|
byte[] |
getAdditionalByteArrayProperty(String name)
|
protected Map |
getAdditionalInfoProperties()
|
List |
getAdditionalListProperty(String name)
|
Long |
getAdditionalLongProperty(String name)
|
Map |
getAdditionalMapProperty(String name)
|
protected Map |
getAdditionalProperties()
|
Object |
getAdditionalProperty(String name)
|
String |
getAdditionalStringProperty(String name)
|
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 |
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. |
protected byte[] |
getHashOverride()
|
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()
|
Object[] |
getQueryableInterfaces()
Query this class for a reference to another class that it may hold |
String |
getRelationText()
A short description of what your class holds that can be printed by the logger |
protected boolean |
getSimpleTorrent()
|
long |
getSize()
|
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. |
void |
print()
A diagnostic method for dumping the tracker contents to "stdout" |
protected String |
readStringFromMetaData(byte[] value)
|
protected String |
readStringFromMetaData(Map meta_data,
String name)
|
void |
removeAdditionalProperties()
remove all additional properties to clear out the torrent |
void |
removeAdditionalProperty(String name)
|
void |
removeListener(TOTorrentListener l)
|
void |
serialiseToBEncodedFile(File output_file)
This method will serialise a torrent using the standard "b-encoding" mechanism into a file |
protected byte[] |
serialiseToByteArray()
|
Map |
serialiseToMap()
This method will serialise a torrent into a Map consistent with that used by the "b-encoding" routines defined elsewhere |
void |
serialiseToXMLFile(File file)
This method will serialise a torrent using an XML encoding to a file |
void |
setAdditionalByteArrayProperty(String name,
byte[] value)
|
void |
setAdditionalListProperty(String name,
List value)
|
void |
setAdditionalLongProperty(String name,
Long value)
|
void |
setAdditionalMapProperty(String name,
Map value)
|
void |
setAdditionalProperty(String name,
Object value)
set an arbitrary property. |
void |
setAdditionalStringProperty(String name,
String value)
The additional properties are used for holding non-core data for Azureus' own user |
boolean |
setAnnounceURL(URL url)
|
protected void |
setComment(byte[] _comment)
|
void |
setComment(String _comment)
|
void |
setCreatedBy(byte[] _created_by)
|
protected void |
setCreatedBy(String _created_by)
|
void |
setCreationDate(long _creation_date)
|
protected void |
setFiles(TOTorrentFileImpl[] _files)
|
protected void |
setHashFromInfo(Map info)
|
void |
setHashOverride(byte[] hash)
Only supported for decentralised torrents, allows an alternative hash to be used for them in the DHT |
protected void |
setName(byte[] _name)
|
protected void |
setNameUTF8(byte[] _name)
|
protected void |
setPieceLength(long _length)
|
void |
setPieces(byte[][] _pieces)
This method exists to support the temporary discarding of piece hashes to conserver memory. |
void |
setPrivate(boolean _private_torrent)
Note - changing the private attribute CHANGES THE TORRENT HASH |
protected void |
setSimpleTorrent(boolean _simple_torrent)
|
protected void |
writeStringToMetaData(Map meta_data,
String name,
String value)
|
protected byte[] |
writeStringToMetaData(String value)
|
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 |
Field Detail |
---|
protected static final String TK_ANNOUNCE
protected static final String TK_ANNOUNCE_LIST
protected static final String TK_COMMENT
protected static final String TK_CREATION_DATE
protected static final String TK_CREATED_BY
protected static final String TK_INFO
protected static final String TK_NAME
protected static final String TK_LENGTH
protected static final String TK_PATH
protected static final String TK_FILES
protected static final String TK_PIECE_LENGTH
protected static final String TK_PIECES
protected static final String TK_PRIVATE
protected static final String TK_NAME_UTF8
protected static final String TK_PATH_UTF8
protected static final String TK_COMMENT_UTF8
protected static final String TK_WEBSEED_BT
protected static final String TK_WEBSEED_GR
protected static final String TK_HASH_OVERRIDE
protected static final List TK_ADDITIONAL_OK_ATTRS
protected final AEMonitor this_mon
Constructor Detail |
---|
protected TOTorrentImpl()
protected TOTorrentImpl(String _torrent_name, URL _announce_url, boolean _simple_torrent) throws TOTorrentException
TOTorrentException
Method Detail |
---|
public void serialiseToBEncodedFile(File output_file) throws TOTorrentException
TOTorrent
serialiseToBEncodedFile
in interface TOTorrent
TOTorrentException
protected byte[] serialiseToByteArray() throws TOTorrentException
TOTorrentException
public Map serialiseToMap() throws TOTorrentException
TOTorrent
serialiseToMap
in interface TOTorrent
TOTorrentException
public void serialiseToXMLFile(File file) throws TOTorrentException
TOTorrent
serialiseToXMLFile
in interface TOTorrent
TOTorrentException
public byte[] getName()
TOTorrent
getName
in interface TOTorrent
protected void setName(byte[] _name)
public String getUTF8Name()
TOTorrent
getUTF8Name
in interface TOTorrent
protected void setNameUTF8(byte[] _name)
public boolean isSimpleTorrent()
TOTorrent
isSimpleTorrent
in interface TOTorrent
public byte[] getComment()
TOTorrent
getComment
in interface TOTorrent
protected void setComment(byte[] _comment)
public void setComment(String _comment)
setComment
in interface TOTorrent
public URL getAnnounceURL()
TOTorrent
getAnnounceURL
in interface TOTorrent
public boolean setAnnounceURL(URL url)
setAnnounceURL
in interface TOTorrent
public boolean isDecentralised()
TOTorrent
isDecentralised
in interface TOTorrent
public long getCreationDate()
TOTorrent
getCreationDate
in interface TOTorrent
public void setCreationDate(long _creation_date)
setCreationDate
in interface TOTorrent
public void setCreatedBy(byte[] _created_by)
setCreatedBy
in interface TOTorrent
protected void setCreatedBy(String _created_by)
public byte[] getCreatedBy()
getCreatedBy
in interface TOTorrent
public boolean isCreated()
isCreated
in interface TOTorrent
public byte[] getHash() throws TOTorrentException
TOTorrent
getHash
in interface TOTorrent
TOTorrentException
public HashWrapper getHashWrapper() throws TOTorrentException
TOTorrent
getHashWrapper
in interface TOTorrent
TOTorrentException
public boolean hasSameHashAs(TOTorrent other)
TOTorrent
hasSameHashAs
in interface TOTorrent
protected void setHashFromInfo(Map info) throws TOTorrentException
TOTorrentException
public void setHashOverride(byte[] hash) throws TOTorrentException
TOTorrent
setHashOverride
in interface TOTorrent
TOTorrentException
protected byte[] getHashOverride()
public void setPrivate(boolean _private_torrent) throws TOTorrentException
TOTorrent
setPrivate
in interface TOTorrent
TOTorrentException
public boolean getPrivate()
getPrivate
in interface TOTorrent
public TOTorrentAnnounceURLGroup getAnnounceURLGroup()
TOTorrent
getAnnounceURLGroup
in interface TOTorrent
protected void addTorrentAnnounceURLSet(URL[] urls)
public long getSize()
getSize
in interface TOTorrent
public long getPieceLength()
TOTorrent
getPieceLength
in interface TOTorrent
protected void setPieceLength(long _length)
public int getNumberOfPieces()
getNumberOfPieces
in interface TOTorrent
public byte[][] getPieces()
getPieces
in interface TOTorrent
public void setPieces(byte[][] _pieces)
TOTorrent
setPieces
in interface TOTorrent
public int getFileCount()
getFileCount
in interface TOTorrent
public TOTorrentFile[] getFiles()
TOTorrent
getFiles
in interface TOTorrent
protected void setFiles(TOTorrentFileImpl[] _files)
protected boolean getSimpleTorrent()
protected void setSimpleTorrent(boolean _simple_torrent)
protected Map getAdditionalProperties()
public void setAdditionalStringProperty(String name, String value)
TOTorrent
setAdditionalStringProperty
in interface TOTorrent
name
- name of the property (e.g. "encoding")value
- value. This will be encoded with default encodingpublic String getAdditionalStringProperty(String name)
getAdditionalStringProperty
in interface TOTorrent
public void setAdditionalByteArrayProperty(String name, byte[] value)
setAdditionalByteArrayProperty
in interface TOTorrent
public void setAdditionalProperty(String name, Object value)
TOTorrent
setAdditionalProperty
in interface TOTorrent
public byte[] getAdditionalByteArrayProperty(String name)
getAdditionalByteArrayProperty
in interface TOTorrent
public void setAdditionalLongProperty(String name, Long value)
setAdditionalLongProperty
in interface TOTorrent
public Long getAdditionalLongProperty(String name)
getAdditionalLongProperty
in interface TOTorrent
public void setAdditionalListProperty(String name, List value)
setAdditionalListProperty
in interface TOTorrent
public List getAdditionalListProperty(String name)
getAdditionalListProperty
in interface TOTorrent
public void setAdditionalMapProperty(String name, Map value)
setAdditionalMapProperty
in interface TOTorrent
public Map getAdditionalMapProperty(String name)
getAdditionalMapProperty
in interface TOTorrent
public Object getAdditionalProperty(String name)
getAdditionalProperty
in interface TOTorrent
public void removeAdditionalProperty(String name)
removeAdditionalProperty
in interface TOTorrent
public void removeAdditionalProperties()
TOTorrent
removeAdditionalProperties
in interface TOTorrent
protected void addAdditionalProperty(String name, Object value)
protected void addAdditionalInfoProperty(String name, Object value)
protected Map getAdditionalInfoProperties()
protected String readStringFromMetaData(Map meta_data, String name) throws TOTorrentException
TOTorrentException
protected String readStringFromMetaData(byte[] value) throws TOTorrentException
TOTorrentException
protected void writeStringToMetaData(Map meta_data, String name, String value) throws TOTorrentException
TOTorrentException
protected byte[] writeStringToMetaData(String value) throws TOTorrentException
TOTorrentException
protected URL anonymityTransform(URL url)
public void print()
TOTorrent
print
in interface TOTorrent
protected void fireChanged(int type)
public void addListener(TOTorrentListener l)
addListener
in interface TOTorrent
public void removeListener(TOTorrentListener l)
removeListener
in interface TOTorrent
public AEMonitor getMonitor()
getMonitor
in interface TOTorrent
public String getRelationText()
LogRelation
getRelationText
in class LogRelation
public Object[] getQueryableInterfaces()
LogRelation
getQueryableInterfaces
in class LogRelation
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |