Search in sources :

Example 66 with COSClient

use of com.qcloud.cos.COSClient in project cos-java-sdk-v5 by tencentyun.

the class WatermarkTemplateDemo method main.

public static void main(String[] args) throws Exception {
    // 1 初始化用户身份信息(secretId, secretKey)。
    COSClient client = ClientUtils.getTestClient();
    // 2 调用要使用的方法。
    describeMediaTemplates(client);
}
Also used : COSClient(com.qcloud.cos.COSClient)

Example 67 with COSClient

use of com.qcloud.cos.COSClient in project cos-java-sdk-v5 by tencentyun.

the class WebpageAuditingJobDemo method main.

public static void main(String[] args) throws InterruptedException {
    // 1 初始化用户身份信息(secretId, secretKey)。
    COSClient client = ClientUtils.getTestClient();
    // 2 调用要使用的方法。
    describeWebpageAuditingJob(client);
}
Also used : COSClient(com.qcloud.cos.COSClient)

Example 68 with COSClient

use of com.qcloud.cos.COSClient in project cos-java-sdk-v5 by tencentyun.

the class WorkFlowDemo method main.

public static void main(String[] args) {
    // 1 初始化用户身份信息(secretId, secretKey)。
    COSClient client = ClientUtils.getTestClient();
    // 2 调用要使用的方法。
    describeWorkflow(client);
}
Also used : COSClient(com.qcloud.cos.COSClient)

Example 69 with COSClient

use of com.qcloud.cos.COSClient in project cos-java-sdk-v5 by tencentyun.

the class GetAsyncFetchTaskDemo method createCosClient.

public static COSClient createCosClient() {
    COSCredentials cred = new BasicCOSCredentials(ak, sk);
    ClientConfig clientConfig = new ClientConfig(new Region(region));
    clientConfig.setHttpProtocol(HttpProtocol.http);
    return new COSClient(cred, clientConfig);
}
Also used : COSClient(com.qcloud.cos.COSClient) COSCredentials(com.qcloud.cos.auth.COSCredentials) BasicCOSCredentials(com.qcloud.cos.auth.BasicCOSCredentials) BasicCOSCredentials(com.qcloud.cos.auth.BasicCOSCredentials) Region(com.qcloud.cos.region.Region) ClientConfig(com.qcloud.cos.ClientConfig)

Example 70 with COSClient

use of com.qcloud.cos.COSClient in project oss-spring-boot-starter by ArtIsLong.

the class TencentOssConfiguration method tencentOssClient.

private StandardOssClient tencentOssClient(TencentOssConfig tencentOssConfig) {
    Region region = region(tencentOssConfig);
    ClientConfig clientConfig = config(region);
    COSCredentials cosCredentials = cosCredentials(tencentOssConfig);
    COSClient cosClient = cosClient(cosCredentials, clientConfig);
    return tencentOssClient(cosClient, tencentOssConfig);
}
Also used : COSClient(com.qcloud.cos.COSClient) COSCredentials(com.qcloud.cos.auth.COSCredentials) BasicCOSCredentials(com.qcloud.cos.auth.BasicCOSCredentials) Region(com.qcloud.cos.region.Region) ClientConfig(com.qcloud.cos.ClientConfig)

Aggregations

COSClient (com.qcloud.cos.COSClient)142 ClientConfig (com.qcloud.cos.ClientConfig)103 Region (com.qcloud.cos.region.Region)99 COSCredentials (com.qcloud.cos.auth.COSCredentials)96 BasicCOSCredentials (com.qcloud.cos.auth.BasicCOSCredentials)93 CosClientException (com.qcloud.cos.exception.CosClientException)38 CosServiceException (com.qcloud.cos.exception.CosServiceException)38 File (java.io.File)22 ObjectMetadata (com.qcloud.cos.model.ObjectMetadata)15 PutObjectResult (com.qcloud.cos.model.PutObjectResult)14 PutObjectRequest (com.qcloud.cos.model.PutObjectRequest)13 TransferManager (com.qcloud.cos.transfer.TransferManager)13 ExecutorService (java.util.concurrent.ExecutorService)13 AnonymousCOSCredentials (com.qcloud.cos.auth.AnonymousCOSCredentials)7 CopyObjectRequest (com.qcloud.cos.model.CopyObjectRequest)7 LinkedList (java.util.LinkedList)7 GetObjectRequest (com.qcloud.cos.model.GetObjectRequest)6 URL (java.net.URL)6 FileOperationException (run.halo.app.exception.FileOperationException)6 Date (java.util.Date)5