com.qcloud.cos.internal.COSObjectResponseHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cos_api Show documentation
Show all versions of cos_api Show documentation
qcloud cos sdk for inner tencentyun
The newest version!
package com.qcloud.cos.internal;
import com.qcloud.cos.http.CosHttpResponse;
import com.qcloud.cos.model.COSObject;
import com.qcloud.cos.model.COSObjectInputStream;
import com.qcloud.cos.model.ObjectMetadata;
public class COSObjectResponseHandler extends AbstractCosResponseHandler {
@Override
public CosServiceResponse handle(CosHttpResponse response) throws Exception {
COSObject object = new COSObject();
CosServiceResponse cosResponse = parseResponseMetadata(response);
ObjectMetadata metadata = object.getObjectMetadata();
populateObjectMetadata(response, metadata);
object.setObjectContent(
new COSObjectInputStream(response.getContent(), response.getHttpRequest()));
cosResponse.setResult(object);
return cosResponse;
}
@Override
public boolean needsConnectionLeftOpen() {
return true;
}
}