private static void addContentMetdataFromHttpRequest( BlobBuilder.PayloadBlobBuilder builder, HttpServletRequest request) { ImmutableMap.Builder<String, String> userMetadata = ImmutableMap.builder(); for (String headerName : Collections.list(request.getHeaderNames())) { if (startsWithIgnoreCase(headerName, USER_METADATA_PREFIX)) { userMetadata.put( headerName.substring(USER_METADATA_PREFIX.length()), Strings.nullToEmpty(request.getHeader(headerName))); } } builder.cacheControl(request.getHeader( HttpHeaders.CACHE_CONTROL)) .contentDisposition(request.getHeader( HttpHeaders.CONTENT_DISPOSITION)) .contentEncoding(request.getHeader( HttpHeaders.CONTENT_ENCODING)) .contentLanguage(request.getHeader( HttpHeaders.CONTENT_LANGUAGE)) .userMetadata(userMetadata.build()); String contentType = request.getContentType(); if (contentType != null) { builder.contentType(contentType); } long expires = request.getDateHeader(HttpHeaders.EXPIRES); if (expires != -1) { builder.expires(new Date(expires)); } }
private static void addContentMetdataFromHttpRequest( BlobBuilder.PayloadBlobBuilder builder, HttpServletRequest request) { ImmutableMap.Builder<String, String> userMetadata = ImmutableMap.builder(); for (String headerName : Collections.list(request.getHeaderNames())) { if (startsWithIgnoreCase(headerName, USER_METADATA_PREFIX)) { userMetadata.put( headerName.substring(USER_METADATA_PREFIX.length()), Strings.nullToEmpty(request.getHeader(headerName))); } } builder.cacheControl(request.getHeader( HttpHeaders.CACHE_CONTROL)) .contentDisposition(request.getHeader( HttpHeaders.CONTENT_DISPOSITION)) .contentEncoding(request.getHeader( HttpHeaders.CONTENT_ENCODING)) .contentLanguage(request.getHeader( HttpHeaders.CONTENT_LANGUAGE)) .userMetadata(userMetadata.build()); String contentType = request.getContentType(); if (contentType != null) { builder.contentType(contentType); } long expires = request.getDateHeader(HttpHeaders.EXPIRES); if (expires != -1) { builder.expires(new Date(expires)); } }
private static void addContentMetdataFromHttpRequest( BlobBuilder.PayloadBlobBuilder builder, HttpServletRequest request) { ImmutableMap.Builder<String, String> userMetadata = ImmutableMap.builder(); for (String headerName : Collections.list(request.getHeaderNames())) { if (startsWithIgnoreCase(headerName, USER_METADATA_PREFIX)) { userMetadata.put( headerName.substring(USER_METADATA_PREFIX.length()), Strings.nullToEmpty(request.getHeader(headerName))); } } builder.cacheControl(request.getHeader( HttpHeaders.CACHE_CONTROL)) .contentDisposition(request.getHeader( HttpHeaders.CONTENT_DISPOSITION)) .contentEncoding(request.getHeader( HttpHeaders.CONTENT_ENCODING)) .contentLanguage(request.getHeader( HttpHeaders.CONTENT_LANGUAGE)) .userMetadata(userMetadata.build()); String contentType = request.getContentType(); if (contentType != null) { builder.contentType(contentType); } long expires = request.getDateHeader(HttpHeaders.EXPIRES); if (expires != -1) { builder.expires(new Date(expires)); } }
.cacheControl(cacheControl) .contentDisposition(contentDisposition) .contentEncoding(contentEncoding)
String cacheControl = contentMetadata.getCacheControl(); if (cacheControl != null) { builder.cacheControl(cacheControl); builder.cacheControl(metadata.getCacheControl()) .contentDisposition(metadata.getContentDisposition()) .contentEncoding(metadata.getContentEncoding())
.cacheControl(cacheControl) .contentDisposition(contentDisposition) .contentEncoding(contentEncoding)
String cacheControl = contentMetadata.getCacheControl(); if (cacheControl != null) { builder.cacheControl(cacheControl); builder.cacheControl(metadata.getCacheControl()) .contentDisposition(metadata.getContentDisposition()) .contentEncoding(metadata.getContentEncoding())
.cacheControl(cacheControl) .contentDisposition(contentDisposition) .contentEncoding(contentEncoding)
String cacheControl = contentMetadata.getCacheControl(); if (cacheControl != null) { builder.cacheControl(cacheControl); builder.cacheControl(metadata.getCacheControl()) .contentDisposition(metadata.getContentDisposition()) .contentEncoding(metadata.getContentEncoding())
metadata = blob.getMetadata().getContentMetadata(); builder.cacheControl(metadata.getCacheControl()) .contentDisposition(metadata.getContentDisposition()) .contentEncoding(metadata.getContentEncoding())
String cacheControl = mpu.blobMetadata().getContentMetadata().getCacheControl(); if (cacheControl != null) { blobBuilder.cacheControl(cacheControl);
String cacheControl = contentMetadata.getCacheControl(); if (cacheControl != null) { builder.cacheControl(cacheControl); builder.cacheControl(metadata.getCacheControl()) .contentDisposition(metadata.getContentDisposition()) .contentEncoding(metadata.getContentEncoding())
metadata = blob.getMetadata().getContentMetadata(); builder.cacheControl(metadata.getCacheControl()) .contentDisposition(metadata.getContentDisposition()) .contentEncoding(metadata.getContentEncoding())
.userMetadata(ImmutableMap.of("key1", "value1", "key2", "value2")) .payload(payload) .cacheControl("max-age=1800") .contentLength(payload.size()) .contentDisposition("attachment; filename=original.jpg")
String cacheControl = mpu.blobMetadata().getContentMetadata().getCacheControl(); if (cacheControl != null) { blobBuilder.cacheControl(cacheControl);
String cacheControl = mpu.blobMetadata().getContentMetadata().getCacheControl(); if (cacheControl != null) { blobBuilder.cacheControl(cacheControl);
String cacheControl = mpu.blobMetadata().getContentMetadata().getCacheControl(); if (cacheControl != null) { blobBuilder.cacheControl(cacheControl);
metadata = blob.getMetadata().getContentMetadata(); builder.cacheControl(metadata.getCacheControl()) .contentDisposition(metadata.getContentDisposition()) .contentEncoding(metadata.getContentEncoding())
metadata = blob.getMetadata().getContentMetadata(); builder.cacheControl(metadata.getCacheControl()) .contentDisposition(metadata.getContentDisposition()) .contentEncoding(metadata.getContentEncoding())
protected void addContentMetadata(PayloadBlobBuilder blobBuilder) { blobBuilder.cacheControl("max-age=3600"); blobBuilder.contentType("text/csv"); blobBuilder.contentDisposition("attachment; filename=photo.jpg"); blobBuilder.contentEncoding("gzip"); blobBuilder.contentLanguage("en"); }