Search in sources :

Example 1 with CrClient

use of com.tencentcloudapi.cr.v20180321.CrClient in project tencentcloud-sdk-java by TencentCloud.

the class UploadDataFile method main.

public static void main(String[] args) {
    try {
        Credential cred = new Credential("secretId", "secretKey");
        HttpProfile httpProfile = new HttpProfile();
        ClientProfile clientProfile = new ClientProfile();
        clientProfile.setHttpProfile(httpProfile);
        CrClient crclient = new CrClient(cred, "ap-guangzhou", clientProfile);
        UploadDataFileRequest udfreq = new UploadDataFileRequest();
        udfreq.setModule("Data");
        udfreq.setOperation("Upload");
        udfreq.setFileName("中文文件名unicodeFileName.xlsx");
        udfreq.setFile(Files.readAllBytes(Paths.get("E:\\data.xlsx")));
        UploadDataFileResponse udfresp = crclient.UploadDataFile(udfreq);
        System.out.println(UploadDataFileResponse.toJsonString(udfresp));
    } catch (Exception e) {
        System.out.println(e);
    }
}
Also used : Credential(com.tencentcloudapi.common.Credential) ClientProfile(com.tencentcloudapi.common.profile.ClientProfile) HttpProfile(com.tencentcloudapi.common.profile.HttpProfile) CrClient(com.tencentcloudapi.cr.v20180321.CrClient) UploadDataFileResponse(com.tencentcloudapi.cr.v20180321.models.UploadDataFileResponse) UploadDataFileRequest(com.tencentcloudapi.cr.v20180321.models.UploadDataFileRequest)

Aggregations

Credential (com.tencentcloudapi.common.Credential)1 ClientProfile (com.tencentcloudapi.common.profile.ClientProfile)1 HttpProfile (com.tencentcloudapi.common.profile.HttpProfile)1 CrClient (com.tencentcloudapi.cr.v20180321.CrClient)1 UploadDataFileRequest (com.tencentcloudapi.cr.v20180321.models.UploadDataFileRequest)1 UploadDataFileResponse (com.tencentcloudapi.cr.v20180321.models.UploadDataFileResponse)1