com.qcloud.cos.model.fetch.GetAsyncFetchTaskResultHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cos_api-bundle Show documentation
Show all versions of cos_api-bundle Show documentation
A single bundled dependency that includes all service and dependent JARs with third-party libraries
relocated to different namespaces.
package com.qcloud.cos.model.fetch;
import com.qcloud.cos.http.CosHttpResponse;
import com.qcloud.cos.internal.AbstractCosResponseHandler;
import com.qcloud.cos.internal.CosServiceResponse;
import com.qcloud.cos.utils.Jackson;
public class GetAsyncFetchTaskResultHandler extends AbstractCosResponseHandler {
@Override
public CosServiceResponse handle(CosHttpResponse response) throws Exception {
String requestId = response.getHeaders().get("x-cos-request-id");
byte[] bytes = new byte[0];
bytes = new byte[response.getContent().available()];
response.getContent().read(bytes);
GetAsyncFetchTaskResult result = Jackson.fromJsonString(new String(bytes), GetAsyncFetchTaskResult.class);
result.setCosRequestId(requestId);
CosServiceResponse cosResponse = new CosServiceResponse();
cosResponse.setResult(result);
return cosResponse;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy