Search in sources :

Example 1 with GoogleCredentialsFromJson

use of org.jclouds.googlecloud.GoogleCredentialsFromJson in project hive by apache.

the class CloudComputeService method getCredentialsFromJsonKeyFile.

public static Credentials getCredentialsFromJsonKeyFile(String filename) throws IOException {
    String fileContents = Files.toString(new File(filename), UTF_8);
    Supplier<Credentials> credentialSupplier = new GoogleCredentialsFromJson(fileContents);
    return credentialSupplier.get();
}
Also used : GoogleCredentialsFromJson(org.jclouds.googlecloud.GoogleCredentialsFromJson) File(java.io.File) Credentials(org.jclouds.domain.Credentials)

Aggregations

File (java.io.File)1 Credentials (org.jclouds.domain.Credentials)1 GoogleCredentialsFromJson (org.jclouds.googlecloud.GoogleCredentialsFromJson)1