21 lines
792 B
Java
21 lines
792 B
Java
package org.gcube.vremanagement;
|
|
|
|
|
|
import com.google.api.client.auth.oauth2.Credential;
|
|
import com.google.api.client.googleapis.javanet.GoogleNetHttpTransport;
|
|
import com.google.api.client.json.jackson2.JacksonFactory;
|
|
import com.google.api.services.sheets.v4.Sheets;
|
|
|
|
import java.io.IOException;
|
|
import java.security.GeneralSecurityException;
|
|
|
|
public class SheetsServiceUtil {
|
|
|
|
private static final String APPLICATION_NAME = "VREsDisposedUpdate";
|
|
|
|
public static Sheets getSheetsService() throws IOException, GeneralSecurityException {
|
|
Credential credential = GoogleAuthorizeUtil.authorize();
|
|
return new Sheets.Builder(GoogleNetHttpTransport.newTrustedTransport(), JacksonFactory.getDefaultInstance(), credential).setApplicationName(APPLICATION_NAME).build();
|
|
}
|
|
|
|
} |