admin管理员组文章数量:1565292
在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
版权声明:本文标题:解析bt种子下载 java_使用Java解析Torrent文件(BT种子),基于使用Eclipse ECF中的org.eclipse.bittorrent方案... 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.elefans.com/dianzi/1727268323a1105728.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论