Skip to content
Snippets Groups Projects
Commit 35db8b1e authored by Elisabethein's avatar Elisabethein
Browse files

Code refactoring #136

parent 7e034626
No related branches found
No related tags found
No related merge requests found
Pipeline #48305 passed
......@@ -5,31 +5,20 @@ import com.google.api.client.extensions.java6.auth.oauth2.AuthorizationCodeInsta
import com.google.api.client.extensions.jetty.auth.oauth2.LocalServerReceiver;
import com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeFlow;
import com.google.api.client.googleapis.auth.oauth2.GoogleClientSecrets;
import com.google.api.client.googleapis.javanet.GoogleNetHttpTransport;
import com.google.api.client.googleapis.json.GoogleJsonResponseException;
import com.google.api.client.http.FileContent;
import com.google.api.client.http.HttpRequestInitializer;
import com.google.api.client.http.javanet.NetHttpTransport;
import com.google.api.client.json.JsonFactory;
import com.google.api.client.json.gson.GsonFactory;
import com.google.api.client.util.store.FileDataStoreFactory;
import com.google.api.services.drive.Drive;
import com.google.api.services.drive.DriveScopes;
import com.google.api.services.drive.model.File;
import com.google.api.services.drive.model.FileList;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.security.GeneralSecurityException;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import com.google.auth.http.HttpCredentialsAdapter;
import com.google.auth.oauth2.GoogleCredentials;
import org.springframework.beans.factory.annotation.Value;
/* class to demonstrate use of Drive files list API */
public class DriveQuickstart {
......@@ -56,16 +45,6 @@ public class DriveQuickstart {
DriveScopes.DRIVE // Full access to the user's drive
);
@Value("${GOOGLE_APPLICATION_CREDENTIALS}")
private static String CREDENTIALS_FILE_PATH;
/**
* Creates an authorized Credential object.
*
* @param HTTP_TRANSPORT The network HTTP Transport.
* @return An authorized Credential object.
* @throws IOException If the credentials.json file cannot be found.
*/
public static Credential getCredentials(final NetHttpTransport HTTP_TRANSPORT)
throws IOException {
// Load client secrets.
......
......@@ -80,7 +80,8 @@ public class TicketManagementTests {
true,
null, // Assuming no pictures for simplicity
59.437,
24.7536
24.7536,
"johnFacebook"
);
@BeforeEach
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment