use of com.google.gdata.data.Person in project OpenRefine by OpenRefine.
the class GDataImportingController method listSpreadsheets.
private void listSpreadsheets(DocsService service, JSONWriter writer) throws IOException, ServiceException, JSONException {
URL metafeedUrl = new URL("https://spreadsheets.google.com/feeds/spreadsheets/private/full");
SpreadsheetFeed feed = service.getFeed(metafeedUrl, SpreadsheetFeed.class);
for (SpreadsheetEntry entry : feed.getEntries()) {
writer.object();
writer.key("docId");
writer.value(entry.getId());
writer.key("docLink");
writer.value(entry.getHtmlLink().getHref());
writer.key("docSelfLink");
writer.value(entry.getSelfLink().getHref());
writer.key("title");
writer.value(entry.getTitle().getPlainText());
writer.key("type");
writer.value("spreadsheet");
DateTime updated = entry.getUpdated();
if (updated != null) {
writer.key("updated");
writer.value(updated.toStringRfc822());
}
writer.key("authors");
writer.array();
for (Person person : entry.getAuthors()) {
writer.value(person.getName());
}
writer.endArray();
writer.endObject();
}
}
Aggregations