Search in sources :

Example 6 with ServiceException

use of com.google.gdata.util.ServiceException in project OpenRefine by OpenRefine.

the class GDataImportingController method getWorksheetEntriesForDoc.

private List<WorksheetEntry> getWorksheetEntriesForDoc(URL docUrl, String token) throws IOException, ServiceException {
    if (token != null) {
        try {
            SpreadsheetService spreadsheetService = GDataExtension.getSpreadsheetService(token);
            SpreadsheetEntry spreadsheetEntry = spreadsheetService.getEntry(docUrl, SpreadsheetEntry.class);
            return spreadsheetEntry.getWorksheets();
        } catch (ServiceException e) {
        // Ignore and fall through, pretending that we're not logged in.
        }
    }
    return getWorksheetEntriesForDoc(docUrl);
}
Also used : ServiceException(com.google.gdata.util.ServiceException) SpreadsheetService(com.google.gdata.client.spreadsheet.SpreadsheetService) SpreadsheetEntry(com.google.gdata.data.spreadsheet.SpreadsheetEntry)

Aggregations

ServiceException (com.google.gdata.util.ServiceException)6 SpreadsheetEntry (com.google.gdata.data.spreadsheet.SpreadsheetEntry)3 WorksheetEntry (com.google.gdata.data.spreadsheet.WorksheetEntry)3 IOException (java.io.IOException)3 URL (java.net.URL)3 ServletException (javax.servlet.ServletException)3 SpreadsheetService (com.google.gdata.client.spreadsheet.SpreadsheetService)2 MalformedURLException (java.net.MalformedURLException)2 JSONObject (org.json.JSONObject)2 Drive (com.google.api.services.drive.Drive)1 File (com.google.api.services.drive.model.File)1 CellQuery (com.google.gdata.client.spreadsheet.CellQuery)1 Link (com.google.gdata.data.Link)1 PlainTextConstruct (com.google.gdata.data.PlainTextConstruct)1 BatchStatus (com.google.gdata.data.batch.BatchStatus)1 Cell (com.google.gdata.data.spreadsheet.Cell)1 CellEntry (com.google.gdata.data.spreadsheet.CellEntry)1 CellFeed (com.google.gdata.data.spreadsheet.CellFeed)1 SpreadsheetFeed (com.google.gdata.data.spreadsheet.SpreadsheetFeed)1 AuthenticationException (com.google.gdata.util.AuthenticationException)1