Search in sources :

Example 1 with DownloadStatus

use of org.cytoscape.app.internal.net.DownloadStatus in project cytoscape-impl by cytoscape.

the class ResolveAppDependenciesTask method run.

@Override
public void run(TaskMonitor taskMonitor) throws Exception {
    this.taskMonitor = taskMonitor;
    status = new DownloadStatus(taskMonitor);
    while (!appQueue.isEmpty()) {
        App app = appQueue.poll();
        resolveAppDependencies(app);
    }
    if (promptToReplace && !appsToReplace.isEmpty())
        insertTasksAfterCurrentTask(new ResolveAppConflictTask(appsToInstall, appsToReplace, appManager));
    else
        insertTasksAfterCurrentTask(new InstallAppsTask(appsToInstall, appsToReplace, appManager));
}
Also used : App(org.cytoscape.app.internal.manager.App) WebApp(org.cytoscape.app.internal.net.WebApp) DownloadStatus(org.cytoscape.app.internal.net.DownloadStatus)

Example 2 with DownloadStatus

use of org.cytoscape.app.internal.net.DownloadStatus in project cytoscape-impl by cytoscape.

the class InstallAppsFromWebAppTask method run.

@Override
public void run(TaskMonitor taskMonitor) throws Exception {
    taskMonitor.setTitle("Install from App Store");
    taskMonitor.setTitle("");
    DownloadStatus status = new DownloadStatus(taskMonitor);
    List<File> appFiles = new ArrayList<File>();
    for (WebApp webApp : webApps) {
        taskMonitor.setStatusMessage("Downloading " + webApp.getFullName());
        // Download app
        File appFile = appManager.getWebQuerier().downloadApp(webApp, null, new File(appManager.getDownloadedAppsPath()), status);
        if (appFile == null) {
            throw new Exception("Unable to find download URL for about-to-be-installed " + webApp.getFullName());
        }
        appFiles.add(appFile);
    }
    insertTasksAfterCurrentTask(new InstallAppsFromFileTask(appFiles, appManager, promptToReplace));
}
Also used : DownloadStatus(org.cytoscape.app.internal.net.DownloadStatus) ArrayList(java.util.ArrayList) File(java.io.File) WebApp(org.cytoscape.app.internal.net.WebApp)

Aggregations

DownloadStatus (org.cytoscape.app.internal.net.DownloadStatus)2 WebApp (org.cytoscape.app.internal.net.WebApp)2 File (java.io.File)1 ArrayList (java.util.ArrayList)1 App (org.cytoscape.app.internal.manager.App)1