Search in sources :

Example 1 with Unmarshallers

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

the class CICommonDemo method processCINotifyResponse.

/**
 * 本示例用于解析回调数据,可通过获取Unmarshallers来进行xml数据的解析
 * 可以通过查看CosClient的接口获取到需要使用的xml解析器
 */
public static void processCINotifyResponse(String response) throws Exception {
    // 这里以文档预览的任务回调为例
    Unmarshallers.DescribeDocJobUnmarshaller describeDocJobUnmarshaller = new Unmarshallers.DescribeDocJobUnmarshaller();
    InputStream is = new ByteArrayInputStream(response.getBytes());
    DocJobResponse docJobResponse = describeDocJobUnmarshaller.unmarshall(is);
    System.out.println(docJobResponse);
}
Also used : Unmarshallers(com.qcloud.cos.internal.Unmarshallers) DocJobResponse(com.qcloud.cos.model.ciModel.job.DocJobResponse) ByteArrayInputStream(java.io.ByteArrayInputStream) ByteArrayInputStream(java.io.ByteArrayInputStream) InputStream(java.io.InputStream)

Aggregations

Unmarshallers (com.qcloud.cos.internal.Unmarshallers)1 DocJobResponse (com.qcloud.cos.model.ciModel.job.DocJobResponse)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 InputStream (java.io.InputStream)1