private void addOptionsHeaders(HTTPRequest req, GcsFileOptions options) {
if (options == null) {
return;
}
if (options.getMimeType() != null) {
req.setHeader(new HTTPHeader(CONTENT_TYPE, options.getMimeType()));
}
if (options.getAcl() != null) {
req.setHeader(new HTTPHeader(ACL, options.getAcl()));
}
if (options.getCacheControl() != null) {
req.setHeader(new HTTPHeader(CACHE_CONTROL, options.getCacheControl()));
}
if (options.getContentDisposition() != null) {
req.setHeader(new HTTPHeader(CONTENT_DISPOSITION, options.getContentDisposition()));
}
if (options.getContentEncoding() != null) {
req.setHeader(new HTTPHeader(CONTENT_ENCODING, options.getContentEncoding()));
}
for (Entry<String, String> entry : options.getUserMetadata().entrySet()) {
req.setHeader(new HTTPHeader(X_GOOG_META + entry.getKey(), entry.getValue()));
}
}