org.gudy.azureus2.core3.torrent.impl
Class TOTorrentCreateImpl

java.lang.Object
  extended by org.gudy.azureus2.core3.logging.LogRelation
      extended by org.gudy.azureus2.core3.torrent.impl.TOTorrentImpl
          extended by org.gudy.azureus2.core3.torrent.impl.TOTorrentCreateImpl
All Implemented Interfaces:
TOTorrentFileHasherListener, TOTorrent

public class TOTorrentCreateImpl
extends TOTorrentImpl
implements TOTorrentFileHasherListener


Field Summary
 
Fields inherited from class org.gudy.azureus2.core3.torrent.impl.TOTorrentImpl
this_mon, TK_ADDITIONAL_OK_ATTRS, TK_ANNOUNCE, TK_ANNOUNCE_LIST, TK_COMMENT, TK_COMMENT_UTF8, TK_CREATED_BY, TK_CREATION_DATE, TK_FILES, TK_HASH_OVERRIDE, TK_INFO, TK_LENGTH, TK_NAME, TK_NAME_UTF8, TK_PATH, TK_PATH_UTF8, TK_PIECE_LENGTH, TK_PIECES, TK_PRIVATE, TK_WEBSEED_BT, 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 TOTorrentCreateImpl(Map<String,File> _linkage_map, File _torrent_base, URL _announce_url, boolean _add_other_hashes, long _piece_length)
           
protected TOTorrentCreateImpl(Map<String,File> _linkage_map, File _torrent_base, URL _announce_url, boolean _add_other_hashes, long _piece_min_size, long _piece_max_size, long _piece_num_lower, long _piece_num_upper)
           
 
Method Summary
protected  void addListener(TOTorrentProgressListener listener)
           
protected  long calculateNumberOfPieces(File _file, long _piece_length)
           
protected  long calculateTotalFileSize(File file)
           
protected  void cancel()
           
protected  void create()
           
static long getComputedPieceSize(long total_size, long _piece_min_size, long _piece_max_size, long _piece_num_lower, long _piece_num_upper)
           
static long getPieceCount(long total_size, long piece_size)
           
protected  long getTotalFileSize(File file)
           
protected  long getTotalFileSizeSupport(File file, String root)
           
 void pieceHashed(int piece_number)
           
protected  void removeListener(TOTorrentProgressListener listener)
           
protected  void report(String resource_key)
           
protected  void report(String resource_key, long bytes)
           
protected  void report(String resource_key, String additional_text)
           
protected  void setIgnoreList()
           
 
Methods inherited from class org.gudy.azureus2.core3.torrent.impl.TOTorrentImpl
addAdditionalInfoProperty, addAdditionalProperty, addListener, addTorrentAnnounceURLSet, anonymityTransform, fireChanged, getAdditionalByteArrayProperty, getAdditionalInfoProperties, getAdditionalListProperty, getAdditionalLongProperty, getAdditionalMapProperty, getAdditionalProperties, getAdditionalProperty, getAdditionalStringProperty, getAnnounceURL, getAnnounceURLGroup, getComment, getCreatedBy, getCreationDate, getFileCount, getFiles, getHash, getHashOverride, getHashWrapper, getMonitor, getName, getNumberOfPieces, getPieceLength, getPieces, getPrivate, getQueryableInterfaces, getRelationText, getSimpleTorrent, getSize, getUTF8Name, hasSameHashAs, isCreated, isDecentralised, isSimpleTorrent, print, readStringFromMetaData, readStringFromMetaData, removeAdditionalProperties, removeAdditionalProperty, removeListener, serialiseToBEncodedFile, serialiseToByteArray, serialiseToMap, serialiseToXMLFile, setAdditionalByteArrayProperty, setAdditionalListProperty, setAdditionalLongProperty, setAdditionalMapProperty, setAdditionalProperty, setAdditionalStringProperty, setAnnounceURL, setComment, setComment, setCreatedBy, setCreatedBy, setCreationDate, setFiles, setHashFromInfo, setHashOverride, setName, setNameUTF8, setPieceLength, setPieces, setPrivate, setSimpleTorrent, writeStringToMetaData, writeStringToMetaData
 
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

TOTorrentCreateImpl

protected TOTorrentCreateImpl(Map<String,File> _linkage_map,
                              File _torrent_base,
                              URL _announce_url,
                              boolean _add_other_hashes,
                              long _piece_length)
                       throws TOTorrentException
Throws:
TOTorrentException

TOTorrentCreateImpl

protected TOTorrentCreateImpl(Map<String,File> _linkage_map,
                              File _torrent_base,
                              URL _announce_url,
                              boolean _add_other_hashes,
                              long _piece_min_size,
                              long _piece_max_size,
                              long _piece_num_lower,
                              long _piece_num_upper)
                       throws TOTorrentException
Throws:
TOTorrentException
Method Detail

create

protected void create()
               throws TOTorrentException
Throws:
TOTorrentException

pieceHashed

public void pieceHashed(int piece_number)
Specified by:
pieceHashed in interface TOTorrentFileHasherListener

calculateNumberOfPieces

protected long calculateNumberOfPieces(File _file,
                                       long _piece_length)
                                throws TOTorrentException
Throws:
TOTorrentException

calculateTotalFileSize

protected long calculateTotalFileSize(File file)
                               throws TOTorrentException
Throws:
TOTorrentException

getTotalFileSize

protected long getTotalFileSize(File file)
                         throws TOTorrentException
Throws:
TOTorrentException

getTotalFileSizeSupport

protected long getTotalFileSizeSupport(File file,
                                       String root)
                                throws TOTorrentException
Throws:
TOTorrentException

report

protected void report(String resource_key)

report

protected void report(String resource_key,
                      long bytes)

report

protected void report(String resource_key,
                      String additional_text)

getComputedPieceSize

public static long getComputedPieceSize(long total_size,
                                        long _piece_min_size,
                                        long _piece_max_size,
                                        long _piece_num_lower,
                                        long _piece_num_upper)

getPieceCount

public static long getPieceCount(long total_size,
                                 long piece_size)

setIgnoreList

protected void setIgnoreList()

cancel

protected void cancel()

addListener

protected void addListener(TOTorrentProgressListener listener)

removeListener

protected void removeListener(TOTorrentProgressListener listener)