Package org.openrefine.extension.gdata
Class GoogleAPIExtension
- java.lang.Object
 - 
- org.openrefine.extension.gdata.GoogleAPIExtension
 
 
- 
public abstract class GoogleAPIExtension extends Object
 
- 
- 
Field Summary
Fields Modifier and Type Field Description protected static com.google.api.client.http.HttpTransportHTTP_TRANSPORTGlobal instance of the HTTP transport.protected static com.google.api.client.json.JsonFactoryJSON_FACTORYGlobal instance of the JSON factory.protected static StringSERVICE_APP_NAME 
- 
Constructor Summary
Constructors Constructor Description GoogleAPIExtension() 
- 
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringextractSpreadSheetId(String url)static StringgetAuthorizationUrl(edu.mit.simile.butterfly.ButterflyModule module, javax.servlet.http.HttpServletRequest request)static com.google.api.services.drive.DrivegetDriveService(String token)static com.google.api.services.sheets.v4.SheetsgetSheetsService(String token)Build and return an authorized Sheets API client service.static StringgetTokenFromCode(edu.mit.simile.butterfly.ButterflyModule module, javax.servlet.http.HttpServletRequest request) 
 - 
 
- 
- 
Field Detail
- 
SERVICE_APP_NAME
protected static final String SERVICE_APP_NAME
- See Also:
 - Constant Field Values
 
 
- 
HTTP_TRANSPORT
protected static final com.google.api.client.http.HttpTransport HTTP_TRANSPORT
Global instance of the HTTP transport. 
- 
JSON_FACTORY
protected static final com.google.api.client.json.JsonFactory JSON_FACTORY
Global instance of the JSON factory. 
 - 
 
- 
Method Detail
- 
getAuthorizationUrl
public static String getAuthorizationUrl(edu.mit.simile.butterfly.ButterflyModule module, javax.servlet.http.HttpServletRequest request) throws MalformedURLException
- Throws:
 MalformedURLException
 
- 
getTokenFromCode
public static String getTokenFromCode(edu.mit.simile.butterfly.ButterflyModule module, javax.servlet.http.HttpServletRequest request) throws IOException
- Throws:
 IOException
 
- 
getDriveService
public static com.google.api.services.drive.Drive getDriveService(String token)
 
- 
getSheetsService
public static com.google.api.services.sheets.v4.Sheets getSheetsService(String token) throws IOException
Build and return an authorized Sheets API client service.- Returns:
 - an authorized Sheets API client service
 - Throws:
 IOException
 
- 
extractSpreadSheetId
public static String extractSpreadSheetId(String url) throws IllegalArgumentException
- Throws:
 IllegalArgumentException
 
 - 
 
 -