All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.qcloud.cos.demo.ci.CICommonDemo Maven / Gradle / Ivy

package com.qcloud.cos.demo.ci;

import com.qcloud.cos.internal.Unmarshallers;
import com.qcloud.cos.model.ciModel.job.DocJobResponse;

import java.io.ByteArrayInputStream;
import java.io.InputStream;

/**
 * 数据万象公共接口逻辑demo展示
 */
public class CICommonDemo {

    public static void main(String[] args) throws Exception {
        String src = "TaskFinishSuccess2021-02-19T15:24:44+08002021-02-19T15:24:45+08001.docxd89c4cf4a728311ebb1229f23e6c9963b1-1001000010001test1/1.jpg11markjrzhang-1251704708test1/${Page}.jpgap-chongqingp3615c32d66fa493bae4c43a5e655ab7fSuccessDocProcess";
        processCINotifyResponse(src);
    }

    /**
     * 本示例用于解析回调数据,可通过获取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);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy