Class TOTorrentCreatorImpl
java.lang.Object
com.biglybt.core.torrent.impl.TOTorrentCreatorImpl
- All Implemented Interfaces:
TOTorrentCreator
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate URLprivate Fileprivate booleanprivate final List<TOTorrentProgressListener> private longprivate longprivate longprivate longprivate longprivate TOTorrentCreateImplprivate final Fileprivate final int -
Constructor Summary
ConstructorsConstructorDescriptionTOTorrentCreatorImpl(int _torrent_type, File _torrent_base) TOTorrentCreatorImpl(int _torrent_type, File _torrent_base, URL _announce_url, boolean _add_other_hashes, long _piece_length) TOTorrentCreatorImpl(int _torrent_type, 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 TypeMethodDescriptionvoidaddListener(TOTorrentProgressListener listener) voidcancel()create()create(boolean skip_hashing) private Fileprivate voidlongprivate longprivate voidmapDirectory(int prefix_length, File target, File temp) private List<TOTorrentCreatorImpl.DescEntry> voidremoveListener(TOTorrentProgressListener listener) voidsetFileIsLayoutDescriptor(boolean b) A 'layout descriptor' is a file that explicitly details the construction of the torrent from a collection of files, rather than relying on a natural file system structure.
-
Field Details
-
torrent_type
private final int torrent_type -
torrent_base
-
announce_url
-
add_other_hashes
private boolean add_other_hashes -
piece_length
private long piece_length -
piece_min_size
private long piece_min_size -
piece_max_size
private long piece_max_size -
piece_num_lower
private long piece_num_lower -
piece_num_upper
private long piece_num_upper -
is_desc
private boolean is_desc -
linkage_map
-
descriptor_dir
-
torrent
-
listeners
-
-
Constructor Details
-
TOTorrentCreatorImpl
-
TOTorrentCreatorImpl
public TOTorrentCreatorImpl(int _torrent_type, File _torrent_base, URL _announce_url, boolean _add_other_hashes, long _piece_length) throws TOTorrentException - Throws:
TOTorrentException
-
TOTorrentCreatorImpl
public TOTorrentCreatorImpl(int _torrent_type, 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
-
setFileIsLayoutDescriptor
public void setFileIsLayoutDescriptor(boolean b) Description copied from interface:TOTorrentCreatorA 'layout descriptor' is a file that explicitly details the construction of the torrent from a collection of files, rather than relying on a natural file system structure. The file is bencoded and consists of a Map with a List- Specified by:
setFileIsLayoutDescriptorin interfaceTOTorrentCreator- Parameters:
b-
-
create
- Specified by:
createin interfaceTOTorrentCreator- Throws:
TOTorrentException
-
create
- Specified by:
createin interfaceTOTorrentCreator- Throws:
TOTorrentException
-
readDescriptor
- Throws:
TOTorrentException
-
mapDirectory
- Throws:
IOException
-
createLayoutMap
- Throws:
TOTorrentException
-
destroyLayoutMap
private void destroyLayoutMap() -
getTorrentDataSizeFromFileOrDir
- Specified by:
getTorrentDataSizeFromFileOrDirin interfaceTOTorrentCreator- Throws:
TOTorrentException
-
getTorrentDataSizeFromFileOrDir
-
cancel
public void cancel()- Specified by:
cancelin interfaceTOTorrentCreator
-
addListener
- Specified by:
addListenerin interfaceTOTorrentCreator
-
removeListener
- Specified by:
removeListenerin interfaceTOTorrentCreator
-