Examples of DownloadTask


Examples of net.minecraftforge.gradle.tasks.abstractutil.DownloadTask

    @SuppressWarnings("serial")
    private void makeObtainTasks()
    {
        // download tasks
        DownloadTask task;

        task = makeTask("downloadClient", DownloadTask.class);
        {
            task.setOutput(delayedFile(Constants.JAR_CLIENT_FRESH));
            task.setUrl(delayedString(Constants.MC_JAR_URL));
        }

        task = makeTask("downloadServer", DownloadTask.class);
        {
            task.setOutput(delayedFile(Constants.JAR_SERVER_FRESH));
            task.setUrl(delayedString(Constants.MC_SERVER_URL));
        }

        ObtainFernFlowerTask mcpTask = makeTask("downloadMcpTools", ObtainFernFlowerTask.class);
        {
            mcpTask.setMcpUrl(delayedString(Constants.MCP_URL));
            mcpTask.setFfJar(delayedFile(Constants.FERNFLOWER));
        }

        DownloadTask getAssetsIndex = makeTask("getAssetsIndex", DownloadTask.class);
        {
            getAssetsIndex.setUrl(delayedString(Constants.ASSETS_INDEX_URL));
            getAssetsIndex.setOutput(delayedFile(Constants.ASSETS + "/indexes/{ASSET_INDEX}.json"));
            getAssetsIndex.setDoesCache(false);

            getAssetsIndex.doLast(new Action<Task>() {
                public void execute(Task task)
                {
                    try
                    {
                        parseAssetIndex();
                    }
                    catch (Exception e)
                    {
                        Throwables.propagate(e);
                    }
                }
            });

            getAssetsIndex.getOutputs().upToDateWhen(new Closure<Boolean>(this, null) {
                public Boolean call(Object... obj)
                {
                    return false;
                }
            });
View Full Code Here

Examples of net.minecraftforge.gradle.tasks.abstractutil.DownloadTask

            });
            task.from(delayedFile(DevConstants.WORKSPACE_ZIP));
            task.into(delayedFile(DevConstants.WORKSPACE));
        }

        DownloadTask task1 = makeTask("downloadBaseInstaller", DownloadTask.class);
        {
            task1.setOutput(delayedFile(DevConstants.INSTALLER_BASE));
            task1.setUrl(delayedString(DevConstants.INSTALLER_URL));
        }

        task1 = makeTask("downloadL4J", DownloadTask.class);
        {
            task1.setOutput(delayedFile(DevConstants.LAUNCH4J));
            task1.setUrl(delayedString(DevConstants.LAUNCH4J_URL));
        }

        task1 = makeTask("updateJson", DownloadTask.class);
        {
            task1.setUrl(delayedString(DevConstants.MC_JSON_URL));
            task1.setOutput(delayedFile(DevConstants.JSON_BASE));
            task1.setDoesCache(false);
        }

        task = makeTask("extractL4J", ExtractTask.class);
        {
            task.dependsOn("downloadL4J");
View Full Code Here

Examples of net.minecraftforge.gradle.tasks.abstractutil.DownloadTask

                if (lib.natives != null)
                {
                    String path = lib.getPathNatives();
                    String taskName = "downloadNatives-" + lib.getArtifactName().split(":")[1];

                    DownloadTask task = makeTask(taskName, DownloadTask.class);
                    {
                        task.setOutput(delayedFile("{CACHE_DIR}/minecraft/" + path));
                        task.setUrl(delayedString(lib.getUrl() + path));
                    }

                    copyTask.from(delayedZipTree("{CACHE_DIR}/minecraft/" + path));
                    copyTask.dependsOn(taskName);
                }
View Full Code Here

Examples of org.openstreetmap.josm.actions.downloadtasks.DownloadTask

    public Collection<DownloadTask> findDownloadTasks(final String url) {
        List<DownloadTask> result = new ArrayList<>();
        for (Class<? extends DownloadTask> taskClass : downloadTasks) {
            if (taskClass != null) {
                try {
                    DownloadTask task = taskClass.getConstructor().newInstance();
                    if (task.acceptsUrl(url)) {
                        result.add(task);
                    }
                } catch (Exception e) {
                    Main.error(e);
                }
View Full Code Here

Examples of org.openstreetmap.josm.actions.downloadtasks.DownloadTask

    public String findSummaryDocumentation() {
        StringBuilder result = new StringBuilder("<table>");
        for (Class<? extends DownloadTask> taskClass : downloadTasks) {
            if (taskClass != null) {
                try {
                    DownloadTask task = taskClass.getConstructor().newInstance();
                    result.append(task.acceptsDocumentationSummary());
                } catch (Exception e) {
                    Main.error(e);
                }
            }
        }
View Full Code Here

Examples of org.openstreetmap.josm.actions.downloadtasks.DownloadTask

     * @param url The URL to open
     */
    public void openUrl(boolean new_layer, final String url) {
        PleaseWaitProgressMonitor monitor = new PleaseWaitProgressMonitor(tr("Download Data"));
        Collection<DownloadTask> tasks = findDownloadTasks(url);
        DownloadTask task = null;
        Future<?> future = null;
        if (!tasks.isEmpty()) {
            // TODO: handle multiple suitable tasks ?
            try {
                task = tasks.iterator().next();
                future = task.loadUrl(new_layer, url, monitor);
            } catch (IllegalArgumentException e) {
                Main.error(e);
            }
        }
        if (future != null) {
View Full Code Here

Examples of org.openstreetmap.josm.actions.downloadtasks.DownloadTask

        }
    }

    @Override
    protected void handleRequest() throws RequestHandlerErrorException {
        DownloadTask osmTask = new DownloadOsmTask();
        try {
            boolean newLayer = isLoadInNewLayer();

            if (command.equals(myCommand)) {
                if (!PermissionPrefWithDefault.LOAD_DATA.isAllowed()) {
                    Main.info("RemoteControl: download forbidden by preferences");
                } else {
                    Area toDownload = null;
                    if (!newLayer) {
                        // find out whether some data has already been downloaded
                        Area present = null;
                        DataSet ds = Main.main.getCurrentDataSet();
                        if (ds != null) {
                            present = ds.getDataSourceArea();
                        }
                        if (present != null && !present.isEmpty()) {
                            toDownload = new Area(new Rectangle2D.Double(minlon,minlat,maxlon-minlon,maxlat-minlat));
                            toDownload.subtract(present);
                            if (!toDownload.isEmpty()) {
                                // the result might not be a rectangle (L shaped etc)
                                Rectangle2D downloadBounds = toDownload.getBounds2D();
                                minlat = downloadBounds.getMinY();
                                minlon = downloadBounds.getMinX();
                                maxlat = downloadBounds.getMaxY();
                                maxlon = downloadBounds.getMaxX();
                            }
                        }
                    }
                    if (toDownload != null && toDownload.isEmpty()) {
                        Main.info("RemoteControl: no download necessary");
                    } else {
                        Future<?> future = osmTask.download(newLayer, new Bounds(minlat,minlon,maxlat,maxlon), null /* let the task manage the progress monitor */);
                        Main.worker.submit(new PostDownloadHandler(osmTask, future));
                    }
                }
            }
        } catch (Exception ex) {
View Full Code Here

Examples of org.openstreetmap.josm.actions.downloadtasks.DownloadTask

     * @param b The bounds value
     * @see #downloadFromParamBounds(boolean, String)
     * @see #downloadFromParamHttp
     */
    private static void downloadFromParamBounds(final boolean rawGps, Bounds b) {
        DownloadTask task = rawGps ? new DownloadGpsTask() : new DownloadOsmTask();
        // asynchronously launch the download task ...
        Future<?> future = task.download(true, b, null);
        // ... and the continuation when the download is finished (this will wait for the download to finish)
        Main.worker.execute(new PostDownloadHandler(task, future));
    }
View Full Code Here

Examples of org.owasp.dependencycheck.data.update.task.DownloadTask

            final ExecutorService downloadExecutors = Executors.newFixedThreadPool(poolSize);
            final ExecutorService processExecutor = Executors.newSingleThreadExecutor();
            final Set<Future<Future<ProcessTask>>> downloadFutures = new HashSet<Future<Future<ProcessTask>>>(maxUpdates);
            for (NvdCveInfo cve : updateable) {
                if (cve.getNeedsUpdate()) {
                    final DownloadTask call = new DownloadTask(cve, processExecutor, cveDB, Settings.getInstance());
                    downloadFutures.add(downloadExecutors.submit(call));
                }
            }
            downloadExecutors.shutdown();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.