com.qcloud.cos.model.PutSymlinkResultHandler 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;
import com.qcloud.cos.Headers;
import com.qcloud.cos.http.CosHttpResponse;
import com.qcloud.cos.internal.AbstractCosResponseHandler;
import com.qcloud.cos.internal.CosServiceResponse;
import java.util.Map;
public class PutSymlinkResultHandler extends AbstractCosResponseHandler {
@Override
public CosServiceResponse handle(CosHttpResponse response) throws Exception {
PutSymlinkResult putSymlinkResult = new PutSymlinkResult();
final CosServiceResponse cosServiceResponse = new CosServiceResponse<>();
for (Map.Entry header : response.getHeaders().entrySet()) {
String key = header.getKey();
String value = header.getValue();
if (Headers.REQUEST_ID.compareToIgnoreCase(key) == 0) {
putSymlinkResult.setRequestId(value);
continue;
}
if (Headers.ETAG.compareToIgnoreCase(key) == 0) {
putSymlinkResult.setETag(value);
continue;
}
if (Headers.STORAGE_CLASS.compareToIgnoreCase(key) == 0) {
putSymlinkResult.setStorageClass(value);
}
}
cosServiceResponse.setResult(putSymlinkResult);
return cosServiceResponse;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy