Package org.klomp.snark.v2
Class FileTree
java.lang.Object
org.klomp.snark.v2.FileTree
Process the file tree.
- Since:
- 0.9.71
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddfiles(Map<String, BEValue> tree, int piece_length, List<List<String>> files, List<Long> lengths, List<MerkleHash> hashes, List<String> base, List<String> atts) This adds padding files and their lengths.static booleanaddPaddingFiles(int piece_length, List<List<String>> files, List<Long> lengths, List<MerkleHash> hashes, List<String> atts) This adds padding files and their lengths and attributes to the three List parameters.
-
Method Details
-
addfiles
public static void addfiles(Map<String, BEValue> tree, int piece_length, List<List<String>> files, List<Long> lengths, List<MerkleHash> hashes, List<String> base, List<String> atts) throws InvalidBEncodingExceptionThis adds padding files and their lengths. Padding files will have a "p" attribute. Padding files will have a null hash.- Parameters:
tree- the file tree, other five args are out parametershashes- entries will be null for padding files and zero-length filesatts- entries will be null if none- Throws:
InvalidBEncodingException
-
addPaddingFiles
public static boolean addPaddingFiles(int piece_length, List<List<String>> files, List<Long> lengths, List<MerkleHash> hashes, List<String> atts) This adds padding files and their lengths and attributes to the three List parameters. Padding files will have a "p" attribute. This may add files with duplicate pad lengths and names; clients are expected to not complain about dups.- Parameters:
files- in/out paramlengths- in/out paramhashes- in/out param may be null for v1-onlyatts- in/out param, must be empty, will be filled up with null or "p"- Returns:
- true if params were modified.
-