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")));
}
}