"extra-"));
mrids.add(mrid);
if (isDefault) {
defaultMrids.add(mrid);
} else {
Artifact metadataArtifact =
DefaultArtifact.newIvyArtifact(mrid, pubdate);
MetadataArtifactDownloadReport madr =
new MetadataArtifactDownloadReport(metadataArtifact);
metadataReports.put(mrid, madr);
realMrids.add(mrid);
}
try {
pubdate = Ivy.DATE_FORMAT.parse(attributes.getValue("pubdate"));
skip = false;
} catch (ParseException e) {
throw new IllegalArgumentException("invalid publication date for "
+ organisation + " " + module + " " + revision + ": "
+ attributes.getValue("pubdate"));
}
}
} else if ("metadata-artifact".equals(qName)) {
if (skip) {
return;
}
MetadataArtifactDownloadReport madr =
(MetadataArtifactDownloadReport) metadataReports.get(mrid);
if (madr != null) {
madr.setDownloadStatus(
DownloadStatus.fromString(attributes.getValue("status")));
madr.setDownloadDetails(attributes.getValue("details"));
madr.setSize(Long.parseLong(attributes.getValue("size")));
madr.setDownloadTimeMillis(Long.parseLong(attributes.getValue("time")));
madr.setSearched(parseBoolean(attributes.getValue("searched")));
if (attributes.getValue("location") != null) {
madr.setLocalFile(new File(attributes.getValue("location")));
}
if (attributes.getValue("original-local-location") != null) {
madr.setOriginalLocalFile(
new File(attributes.getValue("original-local-location")));
}
if (attributes.getValue("origin-location") != null) {
if (ArtifactOrigin.UNKNOWN.getLocation().equals(
attributes.getValue("origin-location"))) {
madr.setArtifactOrigin(ArtifactOrigin.UNKNOWN);
} else {
madr.setArtifactOrigin(
new ArtifactOrigin(
parseBoolean(attributes.getValue("origin-is-local")),
attributes.getValue("origin-location")));
}
}
}
} else if ("artifact".equals(qName)) {
if (skip) {
return;
}
String status = attributes.getValue("status");
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"));