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 ) ) ; } }
Get credentials listed in a JSON file .