private AWSCredentials credentials ( JsonNode credentialsJson ) { String accessKeyId = getText ( credentialsJson , "AccessKeyId" ) ; String secretAccessKey = getText ( credentialsJson , "SecretAccessKey" ) ; String sessionToken = getText ( credentialsJson , "SessionToken" ) ; ValidationUtils . assertStringNotEmpty ( accessKeyId , "AccessKeyId" ) ; ValidationUtils . assertStringNotEmpty ( accessKeyId , "SecretAccessKey" ) ; if ( sessionToken != null ) { return new BasicSessionCredentials ( accessKeyId , secretAccessKey , sessionToken ) ; } else { return new BasicAWSCredentials ( accessKeyId , secretAccessKey ) ; } }
Parse the process output to retrieve the credentials .