Examples of Downloader


Examples of IO.Downloader

                        String subreddit = data.getSubreddit();

                        if (!subreddits.contains(subreddit))
                            continue;

                        Thread t = new Thread(new Downloader(conf, loader, url, title, new IDownloadCallback() {
                            @Override
                            public void onSuccess(String title) {
                                report.success(title);
                            }
View Full Code Here

Examples of com.googlecode.flaxcrawler.download.Downloader

        beforeCrawl(crawlerTask);

        URL url = new URL(crawlerTask.getUrl());
        log.debug("Getting downloader for " + url + "...");
        Downloader downloader = downloaderController.getDownloader(url);
        log.debug("Downloading from " + url + "...");

        Page page = null;

        try {
            page = downloader.download(url);

            if (page != null) {
                crawlerTask.setTimeDownloaded(new Date());

                if (page.getResponseCode() == HttpURLConnection.HTTP_OK) {
View Full Code Here

Examples of com.salas.bb.utils.net.Downloader

        JFrame frame = Application.getDefaultParentFrame();
        dialog = new DownloadsProgressDialog(frame, locations);

        // Create downloader component
        IStreamProgressListener progressListener = dialog.getProgressListener();
        Downloader downloader = new Downloader(progressListener);

        // Initialize target directory
        File targetDirectory = getTargetDirectory();

        List successful = new ArrayList();
        List failed = new ArrayList();

        // Open progress dialog and start downloading packages
        openProgressDialog(dialog, downloader, locations, targetDirectory);
        try
        {
            for (int i = 0; i < locations.length; i++)
            {
                Location location = locations[i];
                try
                {
                    URL locationURL = new URL(location.getLink());
                    downloader.download(locationURL, targetDirectory);
                    successful.add(location);
                } catch (IOException e)
                {
                    LOG.log(Level.SEVERE, MessageFormat.format(
                        Strings.error("invalid.url"),
View Full Code Here

Examples of com.salas.bb.utils.net.Downloader

        /**
         * Invoked when downloading starts.
         */
        public void run()
        {
            Downloader d = new Downloader(null);

            ensureAllDirsPresent(target);
           
            File dir = target.getParentFile();
            final String filename = target.getName();

            try
            {
                d.download(source, dir, filename);
            } catch (InterruptedException e)
            {
                // fall through
            } catch (IOException e)
            {
View Full Code Here

Examples of com.threerings.getdown.net.Downloader

             * having checked at all. */
            protected int _lastCheck = -1;
        };

        // start the download and wait for it to complete
        Downloader dl = new HTTPDownloader(resources, obs);
        if (!dl.download()) {
            if (Thread.interrupted()) {
                throw new InterruptedException("m.applet_stopped");
            }
            throw new MultipleGetdownRunning();
        }
View Full Code Here

Examples of org.apache.karaf.features.internal.download.Downloader

                                String featureResolutionRange) throws Exception {
        for (Subsystem child : children) {
            child.downloadBundles(manager, overrides, featureResolutionRange);
        }
        final Map<String, ResourceImpl> bundles = new ConcurrentHashMap<>();
        final Downloader downloader = manager.createDownloader();
        final Map<BundleInfo, Conditional> infos = new HashMap<>();
        if (feature != null) {
            for (Conditional cond : feature.getConditional()) {
                for (final BundleInfo bi : cond.getBundles()) {
                    infos.put(bi, cond);
                }
            }
            for (BundleInfo bi : feature.getBundles()) {
                infos.put(bi, null);
            }
        }
        for (Map.Entry<BundleInfo, Conditional> entry : infos.entrySet()) {
            final BundleInfo bi = entry.getKey();
            final String loc = bi.getLocation();
            downloader.download(loc, new DownloadCallback() {
                @Override
                public void downloaded(StreamProvider provider) throws Exception {
                    ResourceImpl res = createResource(loc, provider.getMetadata());
                    bundles.put(loc, res);
                }
            });
        }
        for (Clause bundle : Parser.parseClauses(this.bundles.toArray(new String[this.bundles.size()]))) {
            final String loc = bundle.getName();
            downloader.download(loc, new DownloadCallback() {
                @Override
                public void downloaded(StreamProvider provider) throws Exception {
                    ResourceImpl res = createResource(loc, provider.getMetadata());
                    bundles.put(loc, res);
                }
            });
        }
        for (String override : overrides) {
            final String loc = Overrides.extractUrl(override);
            downloader.download(loc, new DownloadCallback() {
                @Override
                public void downloaded(StreamProvider provider) throws Exception {
                    ResourceImpl res = createResource(loc, provider.getMetadata());
                    bundles.put(loc, res);
                }
            });
        }
        downloader.await();
        Overrides.override(bundles, overrides);
        if (feature != null) {
            // Add conditionals
            Map<Conditional, Resource> resConds = new HashMap<>();
            for (Conditional cond : feature.getConditional()) {
View Full Code Here

Examples of org.apache.karaf.features.internal.download.Downloader

        // Populate digraph and resolve
        digraph = new StandardRegionDigraph(null, null);
        populateDigraph(digraph, root);

        Resolver resolver = new ResolverImpl(new Slf4jResolverLog(LOGGER));
        Downloader downloader = manager.createDownloader();
        wiring = resolver.resolve(new SubsystemResolveContext(root, digraph, globalRepository, downloader));
        downloader.await();

        // Remove wiring to the fake environment resource
        if (environmentResource != null) {
            for (List<Wire> wires : wiring.values()) {
                for (Iterator<Wire> iterator = wires.iterator(); iterator.hasNext();) {
View Full Code Here

Examples of org.mage.plugins.card.dl.Downloader

    DownloadPictures.startDownload(null, allCards);
  }
 
  @Override
  public void downloadSymbols() {
    final DownloadGui g = new DownloadGui(new Downloader());

    Iterable<DownloadJob> it = new GathererSymbols();
       
        for(DownloadJob job:it) {
            g.getDownloader().add(job);
View Full Code Here

Examples of org.mage.plugins.card.dl.Downloader

     *
     * @param imagesPath Path to check in and store symbols to. Can be null, in such case default path should be used.
     */
    @Override
    public void downloadSymbols(String imagesPath) {
        final DownloadGui g = new DownloadGui(new Downloader());

        Iterable<DownloadJob> it = new GathererSymbols(imagesPath);

        for (DownloadJob job : it) {
            g.getDownloader().add(job);
View Full Code Here

Examples of org.openoffice.gdocs.util.Downloader

        return documentTitle;
    }

   
    private void downloadURI(final String documentUrl, final URI uri, final Wrapper wrapper, final boolean openAfterDownload) throws MalformedURLException, URISyntaxException {
        final Downloader downloader = wrapper.getDownloader(uri,
            documentUrl);
        final Uploading progressWindow = new Uploading();
        progressWindow.setMessage(wrapper.getSystem()+" -> OpenOffice.org");
        progressWindow.setVisible(true);           
        progressWindow.showProgressBar();
        downloader.addIOListener(new ImportIOListener(documentUrl, progressWindow,openAfterDownload));
        downloader.start();
    }
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.