checkStatus(doc);
NodeList imgs = doc.getElementsByTagName("image");
List<Cover> result = new ArrayList<Cover>(imgs.getLength());
if(imgs.getLength() > 0) {
CoverImpl cover = new CoverImpl();
// select the img
String imgUri;
if( (imgUri = getImage(imgs, "extralarge")) != null) {
cover.setImageUri(imgUri);
} else if( (imgUri = getImage(imgs, "large")) != null) {
cover.setImageUri(imgUri);
} else if( (imgUri = getImage(imgs, "medium")) != null) {
cover.setImageUri(imgUri);
}
// select the thumb
if( (imgUri = getImage(imgs, "medium")) != null) {
cover.setThumbUri(imgUri);
} else if( (imgUri = getImage(imgs, "large")) != null) {
cover.setThumbUri(imgUri);
} else if( (imgUri = getImage(imgs, "extralarge")) != null) {
cover.setThumbUri(imgUri);
}
result.add(cover);
}
return result;