com.google.gdata.data.spreadsheet.SpreadsheetFeed Java Examples

The following examples show how to use com.google.gdata.data.spreadsheet.SpreadsheetFeed. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TGSpreadConnection.java    From micro-integrator with Apache License 2.0 5 votes vote down vote up
private SpreadsheetEntry extractSpreadSheetEntryFromUrl() throws SQLException {
    try {
        URL spreadSheetFeedUrl = this.feedProcessor.getSpreadSheetFeedUrl();
        SpreadsheetFeed feed =
                this.feedProcessor.getFeed(spreadSheetFeedUrl, SpreadsheetFeed.class);
        List<SpreadsheetEntry> entries = feed.getEntries();
        return (entries != null && entries.size() > 0) ? entries.get(0) : null;
    } catch (Exception e) {
        throw new SQLException("Error occurred while extracting spread sheet entry", e);
    }
}
 
Example #2
Source File: TGSpreadConnection.java    From micro-integrator with Apache License 2.0 5 votes vote down vote up
private SpreadsheetFeed extractSpreadSheetFeed() throws SQLException {
    URL spreadSheetFeedUrl;
    try {
        spreadSheetFeedUrl = this.feedProcessor.getSpreadSheetFeedUrl();
    } catch (MalformedURLException e) {
        throw new SQLException("Error occurred while constructing the Spread Sheet Feed URL");
    }
    SpreadsheetQuery spreadSheetQuery =
            TDriverUtil.createSpreadSheetQuery(this.getSpreadSheetName(), spreadSheetFeedUrl);
    return this.feedProcessor.getFeed(spreadSheetQuery, SpreadsheetFeed.class);
}
 
Example #3
Source File: GoogleSheetsService.java    From q with Apache License 2.0 5 votes vote down vote up
private SpreadsheetEntry getSpreadsheet(String reportSpreadsheetName) throws Throwable
{
    SpreadsheetFeed feed = spreadsheetService.getFeed(spreadsheetsFeedUrl, SpreadsheetFeed.class);
    for (SpreadsheetEntry spreadsheet : feed.getEntries()) {
        if (spreadsheet.getTitle().getPlainText().equalsIgnoreCase(reportSpreadsheetName))
            return spreadsheet;
    }
    throw new RuntimeException(String.format("Either user '%s' has no access to the specified spreadsheet, or there is no spreadsheet named '%s'", Properties.serviceAccountEmail.get(), reportSpreadsheetName));
}
 
Example #4
Source File: TGSpreadConnection.java    From micro-integrator with Apache License 2.0 4 votes vote down vote up
public SpreadsheetFeed getSpreadSheetFeed() {
    return spreadSheetFeed;
}