Text r = new Text();
r.data = "";
return r;
}
if (version.equals("all")) {
AssetHistoryIterator it = asset.getHistory();
StringBuilder buf = new StringBuilder();
while(it.hasNext()) {
AssetItem h = it.next();
if (h.getVersionNumber() != 0) {
String checkinComment = h.getCheckinComment();
//String lastMo ... hmm what is needed?
String lastMofiedBy = h.getLastContributor();
if (lastMofiedBy == null || lastMofiedBy.equals("")) {
lastMofiedBy = asset.getCreator();
}
SimpleDateFormat sdf = getISODateFormat();
Calendar lastModDate = h.getLastModified();
if (lastModDate == null ) {
lastModDate = asset.getCreatedDate();
}
String lastModifiedOn = sdf.format(lastModDate.getTime());
buf.append(h.getVersionNumber());
buf.append("=");
buf.append(lastModifiedOn + "," + lastMofiedBy + "," + checkinComment);
if (it.hasNext()) {
buf.append('\n');
}
}
}
Text r = new Text();
r.lastModified = asset.getLastModified();
r.data = buf.toString();
return r;
} else {
long versionNumber = Long.parseLong(version);
AssetHistoryIterator it = asset.getHistory();
while (it.hasNext()) {
AssetItem h = it.next();
if (h.getVersionNumber() == versionNumber) {
return buildAssetContentResponse(pkg, h);
}
}
//hmm... we didn't find it