Search in sources :

Example 11 with MetadataArtifactDownloadReport

use of org.apache.ivy.core.report.MetadataArtifactDownloadReport in project ant-ivy by apache.

the class XmlReportWriter method outputMetadataArtifact.

private void outputMetadataArtifact(PrintWriter out, IvyNode dep) {
    if (dep.getModuleRevision() != null) {
        MetadataArtifactDownloadReport madr = dep.getModuleRevision().getReport();
        out.print("\t\t\t\t<metadata-artifact");
        out.print(" status=\"" + XMLHelper.escape(madr.getDownloadStatus().toString()) + "\"");
        out.print(" details=\"" + XMLHelper.escape(madr.getDownloadDetails()) + "\"");
        out.print(" size=\"" + madr.getSize() + "\"");
        out.print(" time=\"" + madr.getDownloadTimeMillis() + "\"");
        if (madr.getLocalFile() != null) {
            out.print(" location=\"" + XMLHelper.escape(madr.getLocalFile().getAbsolutePath()) + "\"");
        }
        out.print(" searched=\"" + madr.isSearched() + "\"");
        if (madr.getOriginalLocalFile() != null) {
            out.print(" original-local-location=\"" + XMLHelper.escape(madr.getOriginalLocalFile().getAbsolutePath()) + "\"");
        }
        ArtifactOrigin origin = madr.getArtifactOrigin();
        if (origin != null) {
            out.print(" origin-is-local=\"" + String.valueOf(origin.isLocal()) + "\"");
            out.print(" origin-location=\"" + XMLHelper.escape(origin.getLocation()) + "\"");
        }
        out.println("/>");
    }
}
Also used : MetadataArtifactDownloadReport(org.apache.ivy.core.report.MetadataArtifactDownloadReport) ArtifactOrigin(org.apache.ivy.core.cache.ArtifactOrigin)

Aggregations

MetadataArtifactDownloadReport (org.apache.ivy.core.report.MetadataArtifactDownloadReport)11 ResolvedModuleRevision (org.apache.ivy.core.resolve.ResolvedModuleRevision)8 DefaultModuleDescriptor (org.apache.ivy.core.module.descriptor.DefaultModuleDescriptor)6 ModuleRevisionId (org.apache.ivy.core.module.id.ModuleRevisionId)6 ModuleDescriptor (org.apache.ivy.core.module.descriptor.ModuleDescriptor)5 MDResolvedResource (org.apache.ivy.plugins.resolver.util.MDResolvedResource)4 File (java.io.File)3 Date (java.util.Date)3 ResolvedResource (org.apache.ivy.plugins.resolver.util.ResolvedResource)3 IOException (java.io.IOException)2 ParseException (java.text.ParseException)2 Artifact (org.apache.ivy.core.module.descriptor.Artifact)2 Configuration (org.apache.ivy.core.module.descriptor.Configuration)2 DefaultArtifact (org.apache.ivy.core.module.descriptor.DefaultArtifact)2 DefaultDependencyDescriptor (org.apache.ivy.core.module.descriptor.DefaultDependencyDescriptor)2 ModuleId (org.apache.ivy.core.module.id.ModuleId)2 ArtifactDownloadReport (org.apache.ivy.core.report.ArtifactDownloadReport)2 ModuleDescriptorParser (org.apache.ivy.plugins.parser.ModuleDescriptorParser)2 XmlModuleDescriptorParser (org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorParser)2 DependencyResolver (org.apache.ivy.plugins.resolver.DependencyResolver)2