Please analyze the following code file and determine whether it belongs…
- User
Assistant: User: Please analyze the following code file and determine whether it belongs to any of the provided modules based on the listed module descriptions. Note that the provided list of modules may not be exhaustive, and some files may not belong to any of the modules. If the code belongs to a module, Only output the module name, without any explanation or additional information; otherwise, return 'None' if it does not belong to any module.
Modules : { "UI": "Handles the front-end user interface, consisting of HTML, CSS, and JavaScript files generated by the Angular framework. It processes user requests and interacts with the server using AJAX for data retrieval and client-side interactions.""Test Driver": "Facilitates automated regression testing and handles transmission of test data in JSON format. It performs Java testing using TestNG and JavaScript unit-testing with Jest. It also sets up a simulated web server for servlet-level tests and automates end-to-end testing using Selenium Java." "Logic": "Manages the business logic of TEAMMATES, including handling relationships between entities, managing transactions, input value sanitization, access control rights, and interfacing with GAE-provided or third-party APIs." "Storage": "Performs CRUD operations on data entities, validation of data, and abstraction of GQL queries, hiding the complexities of datastore from the Logic component." "Common": "Contains utility classes, custom exceptions, and data transfer objects used across the entire application for easy consolidation and transfer of structured data." "E2E": "Handles end-to-end testing and load & performance testing, providing helpers, abstractions of browser pages, and test cases for E2E tests and L&P tests." "Client": "Contains scripts for administrative tasks, such as migrating data to a new schema and calculating statistics. This module connects directly to the application back-end for administrative purposes." }
Code: package teammates.e2e.util; /** * Class that builds a Gmail service for use in Gmail API. */ final class GmailServiceMaker { /** Global instance of the JSON factory. */ private static final JsonFactory JSON_FACTORY = GsonFactory.getDefaultInstance(); /** Global instance of the HTTP transport. */ private static final HttpTransport HTTP_TRANSPORT; static { try { HTTP_TRANSPORT = GoogleNetHttpTransport.newTrustedTransport(); } catch (GeneralSecurityException | IOException e) { throw new RuntimeException(e); } } private final String username; private final boolean shouldUseFreshCredentials; GmailServiceMaker(String username) { this(username, false); } GmailServiceMaker(String username, boolean shouldUseFreshCredentials) { this.username = username; this.shouldUseFreshCredentials = shouldUseFreshCredentials; } /** * Builds and returns an authorized Gmail client service. */ Gmail makeGmailService() throws IOException { Credential credential = authorizeAndCreateCredentials(); return new Gmail.Builder(HTTP_TRANSPORT, JSON_FACTORY, credential) .setApplicationName("teammates") .build(); } /** * Authorizes the user and creates an authorized Credential. * @return an authorized Credential */ private Credential authorizeAndCreateCredentials() throws IOException { GoogleClientSecrets clientSecrets = loadClientSecretFromJson(); GoogleAuthorizationCodeFlow flow = buildFlow(clientSecrets); if (shouldUseFreshCredentials) { flow.getCredentialDataStore().delete(username); } if (flow.getCredentialDataStore().get(username) == null) { System.out.println("Please login as: " + username); } return getCredentialFromFlow(flow); } private GoogleClientSecrets loadClientSecretFromJson() throws IOException { try (InputStream in = Files.newInputStream(Paths.get(TestProperties.TEST_GMAIL_API_FOLDER, "client_secret.json"))) { return GoogleClientSecrets.load(JSON_FACTORY, new InputStreamReader(in, Const.ENCODING)); } catch (FileNotFoundException e) { throw new RuntimeException("You need to set up your Gmail API credentials." + System.lineSeparator() + "See docs/development.md section \"Deploying to a staging server\".", e); } } private GoogleAuthorizationCodeFlow buildFlow(GoogleClientSecrets clientSecrets) throws IOException { // if the scopes need to change, the user will need to manually delete // <TestProperties.TEST_GMAIL_API_FOLDER>/StoredCredential List<String> scopes = Arrays.asList(GmailScopes.GMAIL_READONLY, GmailScopes.GMAIL_MODIFY); FileDataStoreFactory dataStoreFactory = new FileDataStoreFactory(new File(TestProperties.TEST_GMAIL_API_FOLDER)); return new GoogleAuthorizationCodeFlow.Builder( HTTP_TRANSPORT, JSON_FACTORY, clientSecrets, scopes) .setDataStoreFactory(dataStoreFactory) .setAccessType("offline") .build(); } /** * Gets the credential containing the access token from the flow if it exists. Otherwise a local server receiver is used * to receive authorization code and then exchaAssistant:
- Assistant
E2E