use of com.qcloud.cos.auth.InstanceCredentialsFetcher in project cos-java-sdk-v5 by tencentyun.
the class AbstractCOSClientTest method buildCVMInstanceCredentialsCOSClient.
protected static COSClient buildCVMInstanceCredentialsCOSClient() {
InstanceMetadataCredentialsEndpointProvider endpointProvider = new InstanceMetadataCredentialsEndpointProvider(InstanceMetadataCredentialsEndpointProvider.Instance.CVM);
InstanceCredentialsFetcher instanceCredentialsFetcher = new InstanceCredentialsFetcher(endpointProvider);
COSCredentialsProvider cosCredentialsProvider = new InstanceCredentialsProvider(instanceCredentialsFetcher);
clientConfig = new ClientConfig(new Region(region));
return new COSClient(cosCredentialsProvider, clientConfig);
}
use of com.qcloud.cos.auth.InstanceCredentialsFetcher in project cos-java-sdk-v5 by tencentyun.
the class AbstractCOSClientTest method buildCPMInstanceCredentialsCOSClient.
protected static COSClient buildCPMInstanceCredentialsCOSClient() {
InstanceMetadataCredentialsEndpointProvider endpointProvider = new InstanceMetadataCredentialsEndpointProvider(InstanceMetadataCredentialsEndpointProvider.Instance.CPM);
InstanceCredentialsFetcher instanceCredentialsFetcher = new InstanceCredentialsFetcher(endpointProvider);
COSCredentialsProvider cosCredentialsProvider = new InstanceCredentialsProvider(instanceCredentialsFetcher);
clientConfig = new ClientConfig(new Region(region));
return new COSClient(cosCredentialsProvider, clientConfig);
}
Aggregations