Package com.biglybt.core.torrent.impl
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 boolean
private URL
private File
private boolean
private final List
<TOTorrentProgressListener> private long
private long
private long
private long
private long
private TOTorrentCreateImpl
private final File
private 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 TypeMethodDescriptionvoid
addListener
(TOTorrentProgressListener listener) void
cancel()
create()
create
(boolean skip_hashing) private File
private void
long
private long
private void
mapDirectory
(int prefix_length, File target, File temp) private List
<TOTorrentCreatorImpl.DescEntry> void
removeListener
(TOTorrentProgressListener listener) void
setFileIsLayoutDescriptor
(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:TOTorrentCreator
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. The file is bencoded and consists of a Map with a List- Specified by:
setFileIsLayoutDescriptor
in interfaceTOTorrentCreator
- Parameters:
b
-
-
create
- Specified by:
create
in interfaceTOTorrentCreator
- Throws:
TOTorrentException
-
create
- Specified by:
create
in interfaceTOTorrentCreator
- Throws:
TOTorrentException
-
readDescriptor
- Throws:
TOTorrentException
-
mapDirectory
- Throws:
IOException
-
createLayoutMap
- Throws:
TOTorrentException
-
destroyLayoutMap
private void destroyLayoutMap() -
getTorrentDataSizeFromFileOrDir
- Specified by:
getTorrentDataSizeFromFileOrDir
in interfaceTOTorrentCreator
- Throws:
TOTorrentException
-
getTorrentDataSizeFromFileOrDir
-
cancel
public void cancel()- Specified by:
cancel
in interfaceTOTorrentCreator
-
addListener
- Specified by:
addListener
in interfaceTOTorrentCreator
-
removeListener
- Specified by:
removeListener
in interfaceTOTorrentCreator
-