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 booleanprivate booleanprivate final booleanprivate final booleanprivate booleanprivate static final Comparator<File> private static final Comparator<File> private TOTorrentFileHasherprivate intprivate longprivate longprivate longprivate final List<TOTorrentProgressListener> private intprivate Fileprivate final intprivate longprivate longFields inherited from class 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_GRFields inherited from interface TOTorrent
AZUREUS_PRIVATE_PROPERTIES, AZUREUS_PROPERTIES, DEFAULT_IGNORE_FILES, ENCODING_ACTUALLY_UTF8_KEYS, TT_V1, TT_V1_V2, TT_V2 -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedTOTorrentCreateImpl(int _torrent_type, Map<String, File> _linkage_map, File _torrent_base, URL _announce_url, boolean _add_other_hashes, long _piece_length) protectedTOTorrentCreateImpl(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 voidaddListener(TOTorrentProgressListener listener) protected longcalculateNumberOfPieces(File _file, long _piece_length) protected longcalculateTotalFileSize(File file) protected voidcancel()protected voidcreate(boolean skip_hashing) private intcreateV1(boolean skip_hashing) private intcreateV2(boolean skip_hashing) static longgetComputedPieceSize(long total_size, long _piece_min_size, long _piece_max_size, long _piece_num_lower, long _piece_num_upper) static longgetPieceCount(long total_size, long piece_size) protected longgetTotalFileSize(File file) protected longgetTotalFileSizeSupport(File file, String root) private booleanignoreFile(String file_name) voidpieceHashed(int piece_number) private intprocessDir(TOTorrentFileHasher hasher, File dir, List<TOTorrentFileImpl> encoded, String base_name, String root, long[] torrent_offset) protected voidremoveListener(TOTorrentProgressListener listener) protected voidprotected voidprotected voidprivate voidMethods inherited from class TOTorrentImpl
addAdditionalInfoProperty, addAdditionalProperty, addGlobalListener, addListener, addTorrentAnnounceURLSet, 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, isDecentralised, isExportable, isSimpleTorrent, isSimpleTorrentDisabled, 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, setSimpleTorrentDisabled, setSimpleTorrentDisabledInternal, setSource, setTorrentType, updateExportability, writeStringToMetaData, writeStringToMetaDataMethods inherited from class LogRelation
propogatedRelationText, queryForClassMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface 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:
pieceHashedin 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
-