Class FileTree

java.lang.Object
org.klomp.snark.v2.FileTree

public class FileTree extends Object
Process the file tree.
Since:
0.9.71
  • 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 InvalidBEncodingException
      This 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 parameters
      hashes - entries will be null for padding files and zero-length files
      atts - 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 param
      lengths - in/out param
      hashes - in/out param may be null for v1-only
      atts - in/out param, must be empty, will be filled up with null or "p"
      Returns:
      true if params were modified.