Search in sources :

Example 6 with FileStorage

use of com.frostwire.jlibtorrent.FileStorage in project frostwire by frostwire.

the class TorrentFetcherDownload method calculateSelection.

private boolean[] calculateSelection(TorrentInfo ti, String path) {
    boolean[] selection = new boolean[ti.numFiles()];
    FileStorage fs = ti.files();
    for (int i = 0; i < selection.length; i++) {
        String filePath = fs.filePath(i);
        if (path.endsWith(filePath) || filePath.endsWith(path)) {
            selection[i] = true;
        }
    }
    return selection;
}
Also used : FileStorage(com.frostwire.jlibtorrent.FileStorage)

Aggregations

FileStorage (com.frostwire.jlibtorrent.FileStorage)6 TorrentInfo (com.frostwire.jlibtorrent.TorrentInfo)4 TcpEndpoint (com.frostwire.jlibtorrent.TcpEndpoint)1 TorrentCrawlableSearchResult (com.frostwire.search.torrent.TorrentCrawlableSearchResult)1 TorrentCrawledSearchResult (com.frostwire.search.torrent.TorrentCrawledSearchResult)1 TransferItem (com.frostwire.transfers.TransferItem)1 File (java.io.File)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 LinkedList (java.util.LinkedList)1