Examples of ArtifactDownloadReport


Examples of org.apache.ivy.core.report.ArtifactDownloadReport

        DownloadReport report = resolver.download(new Artifact[] {artifact}, getDownloadOptions());
        assertNotNull(report);

        assertEquals(1, report.getArtifactsReports().length);

        ArtifactDownloadReport ar = report.getArtifactReport(artifact);
        assertNotNull(ar);

        assertEquals(artifact, ar.getArtifact());
        assertEquals(DownloadStatus.NO, ar.getDownloadStatus());
    }
View Full Code Here

Examples of org.apache.ivy.core.report.ArtifactDownloadReport

        RepositoryCacheManager cacheManager = getRepositoryCacheManager();

        clearArtifactAttempts();
        DownloadReport dr = new DownloadReport();
        for (int i = 0; i < artifacts.length; i++) {
            ArtifactDownloadReport adr = cacheManager.download(artifacts[i],
                artifactResourceResolver, downloader, getCacheDownloadOptions(options));
            if (DownloadStatus.FAILED == adr.getDownloadStatus()) {
                if (!ArtifactDownloadReport.MISSING_ARTIFACT.equals(adr.getDownloadDetails())) {
                    Message.warn("\t" + adr);
                }
            } else if (DownloadStatus.NO == adr.getDownloadStatus()) {
                Message.verbose("\t" + adr);
            } else if (LogOptions.LOG_QUIET.equals(options.getLog())) {
                Message.verbose("\t" + adr);
            } else {
                Message.info("\t" + adr);
View Full Code Here

Examples of org.apache.ivy.core.report.ArtifactDownloadReport

        DownloadReport report = resolver.download(new Artifact[] {artifact}, downloadOptions());
        assertNotNull(report);

        assertEquals(1, report.getArtifactsReports().length);

        ArtifactDownloadReport ar = report.getArtifactReport(artifact);
        assertNotNull(ar);

        assertEquals(artifact, ar.getArtifact());
        assertEquals(DownloadStatus.SUCCESSFUL, ar.getDownloadStatus());

        // test to ask to download again, should use cache
        report = resolver.download(new Artifact[] {artifact}, downloadOptions());
        assertNotNull(report);

        assertEquals(1, report.getArtifactsReports().length);

        ar = report.getArtifactReport(artifact);
        assertNotNull(ar);

        assertEquals(artifact, ar.getArtifact());
        assertEquals(DownloadStatus.NO, ar.getDownloadStatus());
    }
View Full Code Here

Examples of org.apache.ivy.core.report.ArtifactDownloadReport

            downloadOptions());
        assertNotNull(report);

        assertEquals(2, report.getArtifactsReports().length);

        ArtifactDownloadReport ar = report.getArtifactReport(profiler);
        assertNotNull(ar);

        assertEquals(profiler, ar.getArtifact());
        assertEquals(DownloadStatus.SUCCESSFUL, ar.getDownloadStatus());

        ar = report.getArtifactReport(trace);
        assertNotNull(ar);

        assertEquals(trace, ar.getArtifact());
        assertEquals(DownloadStatus.SUCCESSFUL, ar.getDownloadStatus());

        // test to ask to download again, should use cache
        report = resolver.download(new Artifact[] {profiler, trace}, downloadOptions());
        assertNotNull(report);

        assertEquals(2, report.getArtifactsReports().length);

        ar = report.getArtifactReport(profiler);
        assertNotNull(ar);

        assertEquals(profiler, ar.getArtifact());
        assertEquals(DownloadStatus.NO, ar.getDownloadStatus());

        ar = report.getArtifactReport(trace);
        assertNotNull(ar);

        assertEquals(trace, ar.getArtifact());
        assertEquals(DownloadStatus.NO, ar.getDownloadStatus());
    }
View Full Code Here

Examples of org.apache.ivy.core.report.ArtifactDownloadReport

                ((RetrieveOptions) new RetrieveOptions().setLog(getLog())).setConfs(confs)
                        .setResolveId(getResolveId()));

            Map moduleRevToArtifactsMap = new HashMap();
            for (Iterator iter = artifactsToCopy.keySet().iterator(); iter.hasNext();) {
                ArtifactDownloadReport artifact = (ArtifactDownloadReport) iter.next();
                Set moduleRevArtifacts = (Set) moduleRevToArtifactsMap.get(artifact.getArtifact()
                        .getModuleRevisionId());
                if (moduleRevArtifacts == null) {
                    moduleRevArtifacts = new HashSet();
                    moduleRevToArtifactsMap.put(artifact.getArtifact().getModuleRevisionId(),
                        moduleRevArtifacts);
                }
                moduleRevArtifacts.add(artifact);
            }
View Full Code Here

Examples of org.apache.ivy.core.report.ArtifactDownloadReport

                    Set artifactsOfModuleRev = (Set) moduleRevToArtifactsMap.get(dependency
                            .getModuleRevision().getId());
                    if (artifactsOfModuleRev != null) {
                        for (Iterator iter = artifactsOfModuleRev.iterator(); iter.hasNext();) {
                            ArtifactDownloadReport artifact = (ArtifactDownloadReport) iter.next();

                            RepositoryCacheManager cache = dependency.getModuleRevision()
                                    .getArtifactResolver().getRepositoryCacheManager();

                            startArtifact(saxHandler, artifact.getArtifact());

                            writeOriginLocationIfPresent(cache, saxHandler, artifact);
                            writeCacheLocationIfPresent(cache, saxHandler, artifact);

                            Set artifactDestPaths = (Set) artifactsToCopy.get(artifact);
View Full Code Here

Examples of org.apache.ivy.core.report.ArtifactDownloadReport

        DownloadReport report = resolver.download(new Artifact[] {artifact}, downloadOptions());
        assertNotNull(report);

        assertEquals(1, report.getArtifactsReports().length);

        ArtifactDownloadReport ar = report.getArtifactReport(artifact);
        assertNotNull(ar);

        assertEquals(artifact, ar.getArtifact());
        assertEquals(DownloadStatus.SUCCESSFUL, ar.getDownloadStatus());

        // test to ask to download again, should use cache
        report = resolver.download(new Artifact[] {artifact}, downloadOptions());
        assertNotNull(report);

        assertEquals(1, report.getArtifactsReports().length);

        ar = report.getArtifactReport(artifact);
        assertNotNull(ar);

        assertEquals(artifact, ar.getArtifact());
        assertEquals(DownloadStatus.NO, ar.getDownloadStatus());
    }
View Full Code Here

Examples of org.apache.ivy.core.report.ArtifactDownloadReport

                }
            }
        }
        for (Iterator iter = artifactsToDownload.iterator(); iter.hasNext();) {
            Artifact art = (Artifact) iter.next();
            ArtifactDownloadReport adr = new ArtifactDownloadReport(art);
            adr.setDownloadStatus(DownloadStatus.FAILED);
            report.addArtifactReport(adr);
        }
        return report;
    }
View Full Code Here

Examples of org.apache.ivy.core.report.ArtifactDownloadReport

                    String artifactName = attributes.getValue("name");
                    String type = attributes.getValue("type");
                    String ext = attributes.getValue("ext");
                    Artifact artifact = new DefaultArtifact(mrid, pubdate, artifactName, type, ext,
                            ExtendableItemHelper.getExtraAttributes(attributes, "extra-"));
                    ArtifactDownloadReport aReport = new ArtifactDownloadReport(artifact);
                    aReport.setDownloadStatus(DownloadStatus.fromString(status));
                    aReport.setDownloadDetails(attributes.getValue("details"));
                    aReport.setSize(Long.parseLong(attributes.getValue("size")));
                    aReport.setDownloadTimeMillis(Long.parseLong(attributes.getValue("time")));
                    if (attributes.getValue("location") != null) {
                        aReport.setLocalFile(new File(attributes.getValue("location")));
                    }
                    if (attributes.getValue("unpackedFile") != null) {
                        aReport.setUnpackedLocalFile(new File(attributes.getValue("unpackedFile")));
                    }
                    revisionArtifacts.add(aReport);
                } else if ("origin-location".equals(qName)) {
                    if (skip) {
                        return;
                    }
                    ArtifactDownloadReport aReport = revisionArtifacts
                            .get(revisionArtifacts.size() - 1);

                    if (ArtifactOrigin.isUnknown(attributes.getValue("location"))) {
                        aReport.setArtifactOrigin(ArtifactOrigin.unkwnown(aReport.getArtifact()));
                    } else {
                        aReport.setArtifactOrigin(new ArtifactOrigin(aReport.getArtifact(),
                                parseBoolean(attributes.getValue("is-local")), attributes
                                        .getValue("location")));
                    }
                } else if ("info".equals(qName)) {
                    String organisation = attributes.getValue("organisation");
View Full Code Here

Examples of org.apache.ivy.core.report.ArtifactDownloadReport

    }

    public ArtifactDownloadReport download(ArtifactOrigin artifact, DownloadOptions options) {
        for (Iterator iter = chain.iterator(); iter.hasNext();) {
            DependencyResolver resolver = (DependencyResolver) iter.next();
            ArtifactDownloadReport adr = resolver.download(artifact, options);
            if (adr.getDownloadStatus() != DownloadStatus.FAILED) {
                return adr;
            }
        }
        ArtifactDownloadReport adr = new ArtifactDownloadReport(artifact.getArtifact());
        adr.setDownloadStatus(DownloadStatus.FAILED);
        return adr;
    }
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.