Search in sources :

Example 6 with Transfer

use of com.frostwire.transfers.Transfer in project frostwire by frostwire.

the class Transfers method getSkipedFiles.

public static Set<File> getSkipedFiles() {
    Set<File> set = new HashSet<>();
    List<Transfer> transfers = TransferManager.instance().getTransfers();
    for (Transfer t : transfers) {
        if (t instanceof UIBittorrentDownload) {
            set.addAll(getSkippedFiles(((UIBittorrentDownload) t).getDl()));
        }
    }
    return set;
}
Also used : Transfer(com.frostwire.transfers.Transfer) File(java.io.File) HashSet(java.util.HashSet)

Example 7 with Transfer

use of com.frostwire.transfers.Transfer in project frostwire by frostwire.

the class Transfers method getIncompleteFiles.

public static Set<File> getIncompleteFiles() {
    Set<File> set = new HashSet<>();
    List<Transfer> transfers = TransferManager.instance().getTransfers();
    for (Transfer t : transfers) {
        if (t instanceof UIBittorrentDownload) {
            set.addAll(((UIBittorrentDownload) t).getDl().getIncompleteFiles());
        }
    }
    return set;
}
Also used : Transfer(com.frostwire.transfers.Transfer) File(java.io.File) HashSet(java.util.HashSet)

Example 8 with Transfer

use of com.frostwire.transfers.Transfer in project frostwire by frostwire.

the class TransferListAdapter method getMenuAdapter.

private MenuAdapter getMenuAdapter(View view) {
    Object tag = view.getTag();
    String title = "";
    List<MenuAction> items = new ArrayList<>();
    if (tag instanceof BittorrentDownload) {
        title = populateBittorrentDownloadMenuActions((BittorrentDownload) tag, items);
    } else if (tag instanceof Transfer) {
        title = populateCloudDownloadMenuActions(tag, items);
    }
    return items.size() > 0 ? new MenuAdapter(contextRef.get(), title, items) : null;
}
Also used : ResumeDownloadMenuAction(com.frostwire.android.gui.adapters.menu.ResumeDownloadMenuAction) MenuAction(com.frostwire.android.gui.views.MenuAction) CopyToClipboardMenuAction(com.frostwire.android.gui.adapters.menu.CopyToClipboardMenuAction) OpenMenuAction(com.frostwire.android.gui.adapters.menu.OpenMenuAction) CancelMenuAction(com.frostwire.android.gui.adapters.menu.CancelMenuAction) TransferDetailsMenuAction(com.frostwire.android.gui.adapters.menu.TransferDetailsMenuAction) PauseDownloadMenuAction(com.frostwire.android.gui.adapters.menu.PauseDownloadMenuAction) BittorrentDownload(com.frostwire.transfers.BittorrentDownload) UIBittorrentDownload(com.frostwire.android.gui.transfers.UIBittorrentDownload) ArrayList(java.util.ArrayList) Transfer(com.frostwire.transfers.Transfer) MenuAdapter(com.frostwire.android.gui.views.MenuAdapter)

Aggregations

Transfer (com.frostwire.transfers.Transfer)8 File (java.io.File)3 CancelMenuAction (com.frostwire.android.gui.adapters.menu.CancelMenuAction)2 OpenMenuAction (com.frostwire.android.gui.adapters.menu.OpenMenuAction)2 ArrayList (java.util.ArrayList)2 HashSet (java.util.HashSet)2 FileDescriptor (com.frostwire.android.core.FileDescriptor)1 TransferListAdapter (com.frostwire.android.gui.adapters.TransferListAdapter)1 CopyToClipboardMenuAction (com.frostwire.android.gui.adapters.menu.CopyToClipboardMenuAction)1 PauseDownloadMenuAction (com.frostwire.android.gui.adapters.menu.PauseDownloadMenuAction)1 ResumeDownloadMenuAction (com.frostwire.android.gui.adapters.menu.ResumeDownloadMenuAction)1 SeedAction (com.frostwire.android.gui.adapters.menu.SeedAction)1 TransferDetailsMenuAction (com.frostwire.android.gui.adapters.menu.TransferDetailsMenuAction)1 TransferManager (com.frostwire.android.gui.transfers.TransferManager)1 UIBittorrentDownload (com.frostwire.android.gui.transfers.UIBittorrentDownload)1 MenuAction (com.frostwire.android.gui.views.MenuAction)1 MenuAdapter (com.frostwire.android.gui.views.MenuAdapter)1 BittorrentDownload (com.frostwire.transfers.BittorrentDownload)1 CopyOnWriteArrayList (java.util.concurrent.CopyOnWriteArrayList)1