Package com.biglybt.core.torrent.impl
Class TOTorrentCreateV2Impl
- java.lang.Object
-
- com.biglybt.core.torrent.impl.TOTorrentCreateV2Impl
-
public class TOTorrentCreateV2Impl extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static interface
TOTorrentCreateV2Impl.Adapter
private class
TOTorrentCreateV2Impl.FileDetails
-
Field Summary
Fields Modifier and Type Field Description private TOTorrentCreateV2Impl.Adapter
adapter
private static int
block_size
private static int
digest_length
private long
file_bytes_hashed
private int
file_index
private int
files_ignored
private boolean
flatten_files
private ByteArrayHashMap<byte[]>
piece_layers
private long
piece_size
private java.io.File
root
private int
synthetic_pad_file_count
private long
total_file_size
private long
total_v1_padding_size
-
Constructor Summary
Constructors Modifier Constructor Description protected
TOTorrentCreateV2Impl(java.io.File _root, long _piece_size, TOTorrentCreateV2Impl.Adapter _adapter)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.Map<java.lang.String,java.lang.Object>
create()
int
getIgnoredFiles()
long
getTotalFileSize()
long
getTotalPadding()
TOTorrentCreateV2Impl.FileDetails
handleFile(java.io.File file, java.lang.String relative_path)
protected static void
lashUpV1Info(TOTorrentImpl torrent)
private static void
lashUpV2Files(TOTorrentImpl torrent, java.util.List<TOTorrentFileImpl> files, java.util.LinkedList<byte[]> path, java.util.Map<java.lang.String,java.lang.Object> node, long piece_length, long[] torrent_offset, long[] pad_details)
static void
main(java.lang.String[] args)
void
processDirectory(java.io.File dir, java.util.Map<java.lang.String,java.util.Map> node, java.lang.String relative_path)
void
processFile(java.io.File file, java.util.Map<java.lang.String,java.util.Map> node, java.lang.String relative_path)
protected static void
setV2FileHashes(TOTorrentImpl torrent)
-
-
-
Field Detail
-
block_size
private static final int block_size
- See Also:
- Constant Field Values
-
digest_length
private static final int digest_length
- See Also:
- Constant Field Values
-
root
private final java.io.File root
-
piece_size
private final long piece_size
-
adapter
private final TOTorrentCreateV2Impl.Adapter adapter
-
piece_layers
private ByteArrayHashMap<byte[]> piece_layers
-
total_file_size
private long total_file_size
-
total_v1_padding_size
private long total_v1_padding_size
-
file_bytes_hashed
private long file_bytes_hashed
-
file_index
private int file_index
-
synthetic_pad_file_count
private int synthetic_pad_file_count
-
files_ignored
private int files_ignored
-
flatten_files
private final boolean flatten_files
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TOTorrentCreateV2Impl
protected TOTorrentCreateV2Impl(java.io.File _root, long _piece_size, TOTorrentCreateV2Impl.Adapter _adapter)
-
-
Method Detail
-
create
protected java.util.Map<java.lang.String,java.lang.Object> create() throws TOTorrentException
- Throws:
TOTorrentException
-
getTotalFileSize
public long getTotalFileSize()
-
getTotalPadding
public long getTotalPadding()
-
getIgnoredFiles
public int getIgnoredFiles()
-
processFile
public void processFile(java.io.File file, java.util.Map<java.lang.String,java.util.Map> node, java.lang.String relative_path) throws TOTorrentException
- Throws:
TOTorrentException
-
processDirectory
public void processDirectory(java.io.File dir, java.util.Map<java.lang.String,java.util.Map> node, java.lang.String relative_path) throws TOTorrentException
- Throws:
TOTorrentException
-
handleFile
public TOTorrentCreateV2Impl.FileDetails handleFile(java.io.File file, java.lang.String relative_path) throws TOTorrentException
- Throws:
TOTorrentException
-
setV2FileHashes
protected static void setV2FileHashes(TOTorrentImpl torrent)
-
lashUpV1Info
protected static void lashUpV1Info(TOTorrentImpl torrent) throws TOTorrentException
- Throws:
TOTorrentException
-
lashUpV2Files
private static void lashUpV2Files(TOTorrentImpl torrent, java.util.List<TOTorrentFileImpl> files, java.util.LinkedList<byte[]> path, java.util.Map<java.lang.String,java.lang.Object> node, long piece_length, long[] torrent_offset, long[] pad_details) throws TOTorrentException
- Throws:
TOTorrentException
-
main
public static void main(java.lang.String[] args)
-
-