Package com.torrent4j.util.bencoding

Examples of com.torrent4j.util.bencoding.BList


  private Date creationDate;

  public TorrentMetadata(BMap dictionary) throws IOException {
    this.trackers
        .add(new MetadataTracker(dictionary.getString("announce")));
    final BList announceListNode = dictionary.getList("announce-list");
    if (announceListNode != null) {
      for (final Object trackerGroup : announceListNode) {
        trackers.add(new MetadataTracker((BList) trackerGroup));
      }
    }
View Full Code Here


    if (dictionary.get("private") != null)
      this.privateTorrent = dictionary.getInteger("private") == 1;
    this.name = dictionary.getString("name");

    if (dictionary.get("files") != null) {
      final BList files = dictionary
          .getList("files");
      for (final Object file : files) {
        this.files.add(new MetadataFile((BMap) file));
      }
    } else {
View Full Code Here

  private long length;
  private String hash;

  public MetadataFile(BMap file) throws IOException {
    if (file.get("path") != null) {
      final BList path = file.getList("path");
      final StringBuilder builder = new StringBuilder();
      for (final Object pathPart : path) {
        builder.append(new String((byte[]) pathPart)).append("/");
      }
      this.fileName = builder.substring(0, builder.length() - 1);
View Full Code Here

TOP

Related Classes of com.torrent4j.util.bencoding.BList

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.