use of com.acgist.snail.pojo.bean.Torrent in project snail by acgist.
the class TorrentController method buildTree.
/**
* <p>新建文件选择树形菜单</p>
*
* @param taskSession 任务信息
*/
public void buildTree(ITaskSession taskSession) {
Torrent torrent = null;
final TreeView<HBox> tree = this.buildTree();
try {
torrent = TorrentContext.getInstance().newTorrentSession(taskSession.getTorrent()).torrent();
} catch (DownloadException e) {
LOGGER.error("种子文件解析异常", e);
Alerts.warn("下载失败", e.getMessage());
}
if (torrent != null) {
this.taskSession = taskSession;
this.torrentSelector = TorrentSelector.newInstance(torrent.name(), this.download, tree);
torrent.getInfo().files().stream().filter(TorrentFile::notPaddingFile).forEach(this.torrentSelector::build);
this.torrentSelector.select(taskSession);
}
}
Aggregations