String attachmentId = entry.getKey();
GoogleDocumentContent metadataDoc = entry.getValue().getContent();
log.info("metadataDoc=" + metadataDoc);
Map<String, String> map = makeMapFromDocument(metadataDoc, "node", "key", "value");
log.info("Attachment metadata for " + attachmentId + ": " + map + ")");
RemoteAttachmentInfo info = new RemoteAttachmentInfoGsonImpl();
info.setRemoteId(attachmentId);
if (map.get("attachment_url") == null) {
log.warning("Attachment " + attachmentId + " has no URL (incomplete upload?), skipping: "
+ map);
continue;
}
info.setPath(map.get("attachment_url"));
if (map.get("filename") != null) {
info.setFilename(map.get("filename"));
}
if (map.get("mime_type") != null) {
info.setMimeType(map.get("mime_type"));
}
if (map.get("size") != null) {
info.setSizeBytes(Long.parseLong(map.get("size")));
}
newTask.addToImport(info);
}
}