admin管理员组

文章数量:1551743

在Java中,当需要解析BT种子文件(Torrent)时,一种方案是使用Eclipse ECF中的org.eclipse.bittorrent。

Torrent是一个使用BEncoding的Dictionary,具体可以查看BEP的相关文档(BEP0003),在此不再赘述。org.eclipse.bittorrent的使用非常简单,但由于其出现的年代已经比较久远,因此其缺点之一就在于解析的是一个Torrent文件的Metadata(参见BEP0009中的metadata一节),即the info-dictionary part of the .torrent file,而没有解析诸如announce等字段。

1、org.eclipse.bittorrent的文档

org.eclipse.bittorrent是Eclipse ECF中的一个插件(这个ECF好像历史也比较久远了),在Elipse官网上可以找到org.eclipse.bittorrent的官方文档。我们所关注的主要是类

org.eclipse.ecf.protocol.bittorrent.TorrentFile,其方法主要包括:

Method Summary

boolean

Returns whether thisTorrentFileis equal to the given object.

java.lang.String[]

Retrieves the names of all of the files’ that is specified by thisTorrent.

java.lang.String

Returns the hexadecimal representation of the hash returned fromgetInfoHash().

ja

本文标签: 种子文件方案torrentbt