code: public Credential getCredentialFromJsonKeyFile(
        String serviceAccountJsonKeyFile, List<String> scopes, HttpTransport transport)
        throws IOException, GeneralSecurityException {
      logger.atFine().log("getCredentialFromJsonKeyFile(%s, %s)", serviceAccountJsonKeyFile, scopes);
  
      try (FileInputStream fis = new FileInputStream(serviceAccountJsonKeyFile)) {
        return GoogleCredentialWithRetry.fromGoogleCredential(
            GoogleCredential.fromStream(fis, transport, JSON_FACTORY).createScoped(scopes));
      }
    }
docs: Get credentials listed in a JSON file.
  
  @param serviceAccountJsonKeyFile A file path pointing to a JSON file containing credentials.
  @param scopes The OAuth scopes that the credential should be valid for.
  @param transport The HttpTransport used for authorization