return headers;
}
public static Image parse(Map<String, String> headers) {
Image image = new Image();
image.setId(headers.get("X-Image-Meta-Id"));
image.setUri(headers.get("Location"));
image.setName(headers.get("X-Image-Meta-Name"));
image.setDiskFormat(headers.get("X-Image-Meta-Disk_format"));
image.setContainerFormat(headers.get("X-Image-Meta-Container_format"));
image.setSize(asLong(headers.get("X-Image-Meta-Size")));
image.setChecksum(headers.get("X-Image-Meta-Checksum"));
image.setCreatedAt(asCalendar(headers.get("X-Image-Meta-Created_at")));
image.setUpdatedAt(asCalendar(headers.get("X-Image-Meta-Updated_at")));
image.setDeletedAt(asCalendar(headers.get("X-Image-Meta-Deleted_at")));
image.setDeleted(asBoolean(headers.get("X-Image-Meta-Deleted")));
image.setStatus(headers.get("X-Image-Meta-Status"));
image.setProtected(asBoolean(headers.get("X-Image-Meta-Protected")));
image.setPublic(asBoolean(headers.get("X-Image-Meta-Is_public")));
image.setMinRam(asInteger(headers.get("X-Image-Meta-Min_ram")));
image.setMinDisk(asInteger(headers.get("X-Image-Meta-Min_disk")));
image.setOwner(headers.get("X-Image-Meta-Owner"));
for(String key : headers.keySet()) {
if(key.startsWith("x-image-meta-property-")) {
image.getProperties().put(key.substring(22), headers.get(key));
}
}
return image;
}