Package com.biglybt.core.torrent.impl
Class TOTorrentCreateImpl
java.lang.Object
com.biglybt.core.logging.LogRelation
com.biglybt.core.torrent.impl.TOTorrentImpl
com.biglybt.core.torrent.impl.TOTorrentCreateImpl
- All Implemented Interfaces:
TOTorrentFileHasherListener
,TOTorrent
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private boolean
private final boolean
private final boolean
private boolean
private static final Comparator<File>
private static final Comparator<File>
private TOTorrentFileHasher
private int
private long
private long
private long
private final List<TOTorrentProgressListener>
private int
private File
private final int
private long
private long
Fields inherited from class com.biglybt.core.torrent.impl.TOTorrentImpl
this_mon, TK_ADDITIONAL_OK_ATTRS, TK_ANNOUNCE, TK_ANNOUNCE_LIST, TK_BEP47_ATTRS, TK_COMMENT, TK_COMMENT_UTF8, TK_CREATED_BY, TK_CREATION_DATE, TK_ENCODING, 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_SOURCE, TK_V2_FILE_TREE, TK_V2_META_VERSION, TK_V2_PIECE_LAYERS, TK_V2_PIECES_ROOT, TK_WEBSEED_BT, TK_WEBSEED_GR
Fields inherited from interface com.biglybt.core.torrent.TOTorrent
AZUREUS_PRIVATE_PROPERTIES, AZUREUS_PROPERTIES, DEFAULT_IGNORE_FILES, ENCODING_ACTUALLY_UTF8_KEYS, TT_V1, TT_V1_V2, TT_V2
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
TOTorrentCreateImpl
(int _torrent_type, Map<String, File> _linkage_map, File _torrent_base, URL _announce_url, boolean _add_other_hashes, long _piece_length) protected
TOTorrentCreateImpl
(int _torrent_type, 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
Modifier and TypeMethodDescriptionprotected void
addListener
(TOTorrentProgressListener listener) protected long
calculateNumberOfPieces
(File _file, long _piece_length) protected long
calculateTotalFileSize
(File file) protected void
cancel()
protected void
create
(boolean skip_hashing) private int
createV1
(boolean skip_hashing) private int
createV2
(boolean skip_hashing) 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) private boolean
ignoreFile
(String file_name) void
pieceHashed
(int piece_number) private int
processDir
(TOTorrentFileHasher hasher, File dir, List<TOTorrentFileImpl> encoded, String base_name, String root, long[] torrent_offset) protected void
removeListener
(TOTorrentProgressListener listener) protected void
protected void
protected void
private void
Methods inherited from class com.biglybt.core.torrent.impl.TOTorrentImpl
addAdditionalInfoProperty, addAdditionalProperty, addGlobalListener, addListener, addTorrentAnnounceURLSet, anonymityTransform, fireChanged, fixupRootHashes, getAdditionalByteArrayProperty, getAdditionalInfoProperties, getAdditionalListProperty, getAdditionalLongProperty, getAdditionalMapProperty, getAdditionalProperties, getAdditionalProperty, getAdditionalStringProperty, getAnnounceURL, getAnnounceURLGroup, getComment, getCreatedBy, getCreationDate, getFileCount, getFiles, getFullHash, getHash, getHashOverride, getHashWrapper, getMonitor, getName, getNumberOfPieces, getPieceLength, getPieces, getPrivate, getQueryableInterfaces, getRelationText, getSimpleTorrent, getSize, getSource, getTorrentType, getUTF8Name, hasSameHashAs, isCreated, isDecentralised, isExportable, isSimpleTorrent, print, readStringFromMetaData, readStringFromMetaData, removeAdditionalProperties, removeAdditionalProperty, removeGlobalListener, removeListener, selectHybridHashType, serialiseToBEncodedFile, serialiseToByteArray, serialiseToMap, serialiseToXMLFile, setAdditionalByteArrayProperty, setAdditionalListProperty, setAdditionalLongProperty, setAdditionalMapProperty, setAdditionalProperty, setAdditionalStringProperty, setAnnounceURL, setComment, setComment, setConstructed, setCreatedBy, setCreatedBy, setCreationDate, setFiles, setHashFromInfo, setHashOverride, setName, setNameUTF8, setPiece, setPieceLength, setPieces, setPrivate, setSimpleTorrent, setSource, setTorrentType, updateExportability, writeStringToMetaData, writeStringToMetaData
Methods inherited from class com.biglybt.core.logging.LogRelation
propogatedRelationText, queryForClass
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.biglybt.core.torrent.TOTorrent
getEffectiveTorrentType, getTruncatedHash
-
Field Details
-
file_comparator
-
file_comparator_v2
-
torrent_type
private final int torrent_type -
torrent_base
-
piece_length
private long piece_length -
file_hasher
-
total_file_size_no_pad
private long total_file_size_no_pad -
total_file_count_no_pad
private long total_file_count_no_pad -
piece_count_no_pad
private long piece_count_no_pad -
add_other_hashes
private boolean add_other_hashes -
add_pad_files
private boolean add_pad_files -
pad_file_num
private int pad_file_num -
pad_file_sizes
private long pad_file_sizes -
add_v1
private final boolean add_v1 -
add_v2
private final boolean add_v2 -
progress_listeners
-
reported_progress
private int reported_progress -
ignore_set
-
linkage_map
-
linked_tf_map
-
cancelled
private volatile boolean cancelled
-
-
Constructor Details
-
TOTorrentCreateImpl
protected TOTorrentCreateImpl(int _torrent_type, 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(int _torrent_type, 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 Details
-
create
- Throws:
TOTorrentException
-
createV1
- Throws:
TOTorrentException
-
createV2
- Throws:
TOTorrentException
-
processDir
private int processDir(TOTorrentFileHasher hasher, File dir, List<TOTorrentFileImpl> encoded, String base_name, String root, long[] torrent_offset) throws TOTorrentException - Throws:
TOTorrentException
-
pieceHashed
public void pieceHashed(int piece_number) - Specified by:
pieceHashed
in interfaceTOTorrentFileHasherListener
-
calculateNumberOfPieces
- Throws:
TOTorrentException
-
calculateTotalFileSize
- Throws:
TOTorrentException
-
getTotalFileSize
- Throws:
TOTorrentException
-
getTotalFileSizeSupport
- Throws:
TOTorrentException
-
report
-
report
-
report
-
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
private void setIgnoreList() -
ignoreFile
-
cancel
protected void cancel() -
addListener
-
removeListener
-