addResponseHeaderWithOverride(request, response, HttpHeaders.CACHE_CONTROL, "response-cache-control", contentMetadata.getCacheControl()); addResponseHeaderWithOverride(request, response, HttpHeaders.CONTENT_ENCODING, "response-content-encoding",
String cacheControl = contentMetadata.getCacheControl(); if (cacheControl != null) { headers.put(AzureStorageHeaders.CACHE_CONTROL, cacheControl);
String cacheControl = contentMetadata.getCacheControl(); if (cacheControl != null) { headers.put(AzureStorageHeaders.CACHE_CONTROL, cacheControl);
@Override public Multimap<String, String> toHeaders(ContentMetadata md) { Builder<String, String> builder = ImmutableMultimap.builder(); if (md.getCacheControl() != null) builder.put(CACHE_CONTROL, md.getCacheControl()); if (md.getContentType() != null) builder.put(CONTENT_TYPE, md.getContentType()); if (md.getContentDisposition() != null) builder.put(CONTENT_DISPOSITION, md.getContentDisposition()); if (md.getContentEncoding() != null) builder.put(CONTENT_ENCODING, md.getContentEncoding()); if (md.getContentLanguage() != null) builder.put(CONTENT_LANGUAGE, md.getContentLanguage()); if (md.getContentLength() != null) builder.put(CONTENT_LENGTH, md.getContentLength() + ""); if (md.getContentMD5() != null) builder.put(CONTENT_MD5, base64().encode(md.getContentMD5())); if (md.getExpires() != null) builder.put(EXPIRES, getExpiresDateCodec().toString(md.getExpires())); return builder.build(); }
@Override public Multimap<String, String> toHeaders(ContentMetadata md) { Builder<String, String> builder = ImmutableMultimap.builder(); if (md.getCacheControl() != null) builder.put(CACHE_CONTROL, md.getCacheControl()); if (md.getContentType() != null) builder.put(CONTENT_TYPE, md.getContentType()); if (md.getContentDisposition() != null) builder.put(CONTENT_DISPOSITION, md.getContentDisposition()); if (md.getContentEncoding() != null) builder.put(CONTENT_ENCODING, md.getContentEncoding()); if (md.getContentLanguage() != null) builder.put(CONTENT_LANGUAGE, md.getContentLanguage()); if (md.getContentLength() != null) builder.put(CONTENT_LENGTH, md.getContentLength() + ""); if (md.getContentMD5() != null) builder.put(CONTENT_MD5, base64().encode(md.getContentMD5())); if (md.getExpires() != null) builder.put(EXPIRES, getExpiresDateCodec().toString(md.getExpires())); return builder.build(); }
@Override public Multimap<String, String> toHeaders(ContentMetadata md) { Builder<String, String> builder = ImmutableMultimap.builder(); if (md.getCacheControl() != null) builder.put(CACHE_CONTROL, md.getCacheControl()); if (md.getContentType() != null) builder.put(CONTENT_TYPE, md.getContentType()); if (md.getContentDisposition() != null) builder.put(CONTENT_DISPOSITION, md.getContentDisposition()); if (md.getContentEncoding() != null) builder.put(CONTENT_ENCODING, md.getContentEncoding()); if (md.getContentLanguage() != null) builder.put(CONTENT_LANGUAGE, md.getContentLanguage()); if (md.getContentLength() != null) builder.put(CONTENT_LENGTH, md.getContentLength() + ""); if (md.getContentMD5() != null) builder.put(CONTENT_MD5, base64().encode(md.getContentMD5())); if (md.getExpires() != null) builder.put(EXPIRES, getExpiresDateCodec().toString(md.getExpires())); return builder.build(); }
String cacheControl = contentMetadata.getCacheControl(); if (cacheControl != null) { headers.put("x-ms-blob-cache-control", cacheControl);
private void writeCommonMetadataAttr(UserDefinedFileAttributeView view, Blob blob) throws IOException { ContentMetadata metadata = blob.getMetadata().getContentMetadata(); writeStringAttributeIfPresent(view, XATTR_CACHE_CONTROL, metadata.getCacheControl()); writeStringAttributeIfPresent(view, XATTR_CONTENT_DISPOSITION, metadata.getContentDisposition()); writeStringAttributeIfPresent(view, XATTR_CONTENT_ENCODING, metadata.getContentEncoding()); writeStringAttributeIfPresent(view, XATTR_CONTENT_LANGUAGE, metadata.getContentLanguage()); writeStringAttributeIfPresent(view, XATTR_CONTENT_TYPE, metadata.getContentType()); Date expires = metadata.getExpires(); if (expires != null) { ByteBuffer buf = ByteBuffer.allocate(Longs.BYTES).putLong(expires.getTime()); buf.flip(); view.write(XATTR_EXPIRES, buf); } for (Map.Entry<String, String> entry : blob.getMetadata().getUserMetadata().entrySet()) { writeStringAttributeIfPresent(view, XATTR_USER_METADATA_PREFIX + entry.getKey(), entry.getValue()); } }
if (md.getContentMetadata().getCacheControl() != null) { headers.put(HttpHeaders.CACHE_CONTROL, md.getContentMetadata().getCacheControl());
private void writeCommonMetadataAttr(UserDefinedFileAttributeView view, Blob blob) throws IOException { ContentMetadata metadata = blob.getMetadata().getContentMetadata(); writeStringAttributeIfPresent(view, XATTR_CACHE_CONTROL, metadata.getCacheControl()); writeStringAttributeIfPresent(view, XATTR_CONTENT_DISPOSITION, metadata.getContentDisposition()); writeStringAttributeIfPresent(view, XATTR_CONTENT_ENCODING, metadata.getContentEncoding()); writeStringAttributeIfPresent(view, XATTR_CONTENT_LANGUAGE, metadata.getContentLanguage()); writeStringAttributeIfPresent(view, XATTR_CONTENT_TYPE, metadata.getContentType()); Date expires = metadata.getExpires(); if (expires != null) { ByteBuffer buf = ByteBuffer.allocate(Longs.BYTES).putLong(expires.getTime()); buf.flip(); view.write(XATTR_EXPIRES, buf); } writeStringAttributeIfPresent(view, XATTR_STORAGE_TIER, blob.getMetadata().getTier().toString()); for (Map.Entry<String, String> entry : blob.getMetadata().getUserMetadata().entrySet()) { writeStringAttributeIfPresent(view, XATTR_USER_METADATA_PREFIX + entry.getKey(), entry.getValue()); } }
private void writeCommonMetadataAttr(UserDefinedFileAttributeView view, Blob blob) throws IOException { ContentMetadata metadata = blob.getMetadata().getContentMetadata(); writeStringAttributeIfPresent(view, XATTR_CACHE_CONTROL, metadata.getCacheControl()); writeStringAttributeIfPresent(view, XATTR_CONTENT_DISPOSITION, metadata.getContentDisposition()); writeStringAttributeIfPresent(view, XATTR_CONTENT_ENCODING, metadata.getContentEncoding()); writeStringAttributeIfPresent(view, XATTR_CONTENT_LANGUAGE, metadata.getContentLanguage()); writeStringAttributeIfPresent(view, XATTR_CONTENT_TYPE, metadata.getContentType()); Date expires = metadata.getExpires(); if (expires != null) { ByteBuffer buf = ByteBuffer.allocate(Longs.BYTES).putLong(expires.getTime()); buf.flip(); view.write(XATTR_EXPIRES, buf); } writeStringAttributeIfPresent(view, XATTR_STORAGE_TIER, blob.getMetadata().getTier().toString()); for (Map.Entry<String, String> entry : blob.getMetadata().getUserMetadata().entrySet()) { writeStringAttributeIfPresent(view, XATTR_USER_METADATA_PREFIX + entry.getKey(), entry.getValue()); } }
public static void copy(ContentMetadata fromMd, MutableContentMetadata toMd) { toMd.setCacheControl(fromMd.getCacheControl()); toMd.setContentLength(fromMd.getContentLength()); toMd.setContentMD5(fromMd.getContentMD5()); toMd.setContentType(fromMd.getContentType()); toMd.setContentDisposition(fromMd.getContentDisposition()); toMd.setContentEncoding(fromMd.getContentEncoding()); toMd.setContentLanguage(fromMd.getContentLanguage()); toMd.setExpires(fromMd.getExpires()); }
public static void copy(ContentMetadata fromMd, MutableContentMetadata toMd) { toMd.setCacheControl(fromMd.getCacheControl()); toMd.setContentLength(fromMd.getContentLength()); toMd.setContentMD5(fromMd.getContentMD5()); toMd.setContentType(fromMd.getContentType()); toMd.setContentDisposition(fromMd.getContentDisposition()); toMd.setContentEncoding(fromMd.getContentEncoding()); toMd.setContentLanguage(fromMd.getContentLanguage()); toMd.setExpires(fromMd.getExpires()); }
public static void copy(ContentMetadata fromMd, MutableContentMetadata toMd) { toMd.setCacheControl(fromMd.getCacheControl()); toMd.setContentLength(fromMd.getContentLength()); toMd.setContentMD5(fromMd.getContentMD5()); toMd.setContentType(fromMd.getContentType()); toMd.setContentDisposition(fromMd.getContentDisposition()); toMd.setContentEncoding(fromMd.getContentEncoding()); toMd.setContentLanguage(fromMd.getContentLanguage()); toMd.setExpires(fromMd.getExpires()); }
public static BaseMutableContentMetadata fromContentMetadata(ContentMetadata in) { return (BaseMutableContentMetadata) new BaseMutableContentMetadata() .cacheControl(in.getCacheControl()) .contentDisposition(in.getContentDisposition()) .contentEncoding(in.getContentEncoding()) .contentLanguage(in.getContentLanguage()) .contentLength(in.getContentLength()) .contentMD5(in.getContentMD5()) .contentType(in.getContentType()) .expires(in.getExpires()); } }
public static BaseMutableContentMetadata fromContentMetadata(ContentMetadata in) { return (BaseMutableContentMetadata) new BaseMutableContentMetadata() .cacheControl(in.getCacheControl()) .contentDisposition(in.getContentDisposition()) .contentEncoding(in.getContentEncoding()) .contentLanguage(in.getContentLanguage()) .contentLength(in.getContentLength()) .contentMD5(in.getContentMD5()) .contentType(in.getContentType()) .expires(in.getExpires()); } }
public static ContentMetadataBuilder fromContentMetadata(ContentMetadata in) { return new ContentMetadataBuilder() .cacheControl(in.getCacheControl()).contentType(in.getContentType()).contentLength(in.getContentLength()) .contentMD5(in.getContentMD5()).contentDisposition(in.getContentDisposition()).contentLanguage( in.getContentLanguage()).contentEncoding(in.getContentEncoding()).expires(in.getExpires()); }
public static ContentMetadataBuilder fromContentMetadata(ContentMetadata in) { return new ContentMetadataBuilder() .cacheControl(in.getCacheControl()).contentType(in.getContentType()).contentLength(in.getContentLength()) .contentMD5(in.getContentMD5()).contentDisposition(in.getContentDisposition()).contentLanguage( in.getContentLanguage()).contentEncoding(in.getContentEncoding()).expires(in.getExpires()); }
public static ContentMetadataBuilder fromContentMetadata(ContentMetadata in) { return new ContentMetadataBuilder() .cacheControl(in.getCacheControl()).contentType(in.getContentType()).contentLength(in.getContentLength()) .contentMD5(in.getContentMD5()).contentDisposition(in.getContentDisposition()).contentLanguage( in.getContentLanguage()).contentEncoding(in.getContentEncoding()).expires(in.getExpires()); }
public static BaseMutableContentMetadata fromContentMetadata(ContentMetadata in) { return (BaseMutableContentMetadata) new BaseMutableContentMetadata() .cacheControl(in.getCacheControl()) .contentDisposition(in.getContentDisposition()) .contentEncoding(in.getContentEncoding()) .contentLanguage(in.getContentLanguage()) .contentLength(in.getContentLength()) .contentMD5(in.getContentMD5()) .contentType(in.getContentType()) .expires(in.getExpires()); } }