final FileListing listing = listings[i];
if (listing == null) {
continue; // *** SKIP ***
}
final DescribeImagesResponseItemType dirit =
new DescribeImagesResponseItemType();
dirit.setArchitecture("i386"); // todo
final String name = listing.getName();
if (!inReq(name, req)) {
continue;
}
try {
// all from same place currently
givenLocationBase = this.repository.getImageLocation(caller, name);
} catch (CannotTranslateException e) {
throw new RuntimeException("Unexpected: " + e.getMessage(), e);
}
if (givenLocationBase == null) {
throw new IllegalArgumentException(
"givenLocationBase may not be null");
}
//String locationBase = cleanLocationBase(givenLocationBase);
dirit.setImageId(name);
dirit.setImageLocation(givenLocationBase + "/");
dirit.setImageOwnerId(ownerID);
dirit.setImageState("available"); // todo
dirit.setImageType("machine"); // todo
dirit.setIsPublic(!listing.isReadWrite()); // cloud convention
dirit.setKernelId("default-kernel"); // todo
dirit.setRamdiskId("default-ramdisk"); // todo
dirit.setBlockDeviceMapping(new BlockDeviceMappingType(
new BlockDeviceMappingItemType[]{}));
retList.add(dirit);
}
dirits.setItem(