public static class ServiceAccountCredentials.Builder extends Object
ServiceAccountCredentials
instance.Constructor and Description |
---|
Builder()
Constructs a
Builder instance. |
Modifier and Type | Method and Description |
---|---|
ServiceAccountCredentials |
build()
Returns a new
ServiceAccountCredentials instance built from the current state of this builder. |
ServiceAccountCredentials.Builder |
fromFile(String credentialsFilePath)
Sets Service Account Credentials using the JSON credentials file path.
|
ServiceAccountCredentials.Builder |
withAccountId(String accountId)
Set Account Id (format: id@techacct.adobe.com)
|
ServiceAccountCredentials.Builder |
withClientId(String clientId)
Set Client ID (API Key)
|
ServiceAccountCredentials.Builder |
withClientSecret(String clientSecret)
Set Client Secret
|
ServiceAccountCredentials.Builder |
withOrganizationId(String organizationId)
Set Organization Id (format: org_ident@AdobeOrg) that has been configured for access to PDF Tools API
|
ServiceAccountCredentials.Builder |
withPrivateKey(String privateKey)
Set private key
|
public ServiceAccountCredentials.Builder withClientId(String clientId)
clientId
- public ServiceAccountCredentials.Builder withClientSecret(String clientSecret)
clientSecret
- public ServiceAccountCredentials.Builder withPrivateKey(String privateKey)
privateKey
- content of the private key file in PEM formatpublic ServiceAccountCredentials.Builder withOrganizationId(String organizationId)
organizationId
- public ServiceAccountCredentials.Builder withAccountId(String accountId)
accountId
- public ServiceAccountCredentials.Builder fromFile(String credentialsFilePath) throws IOException
JSON structure:
{ "client_credentials": { "client_id": "CLIENT_ID", "client_secret": "CLIENT_SECRET" }, "service_account_credentials": { "organization_id": "org_ident@AdobeOrg", "account_id": "id@techacct.adobe.com", "private_key_file": "private.key" } }private_key_file is the path of private key file. It will be looked up in the classpath and the directory of JSON credentials file.
IOException
public ServiceAccountCredentials build()
ServiceAccountCredentials
instance built from the current state of this builder.ServiceAccountCredentials
instanceIllegalArgumentException
- if any of clientId, clientSecret, privateKey, accountId and organizationId are not provided.Copyright © 2020 Adobe. All rights reserved.