Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2011-2015 Amazon Technologies, Inc.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at:
   *
   *    http://aws.amazon.com/apache2.0
   *
  * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
  * OR CONDITIONS OF ANY KIND, either express or implied. See the
  * License for the specific language governing permissions and
  * limitations under the License.
  */
 package com.amazonaws.services.s3.model;
 
Container object for overriding headers on a GetObjectRequest or GeneratePresignedUrlRequest response. Response headers can be set on a GetObjectRequest or a GeneratePresignedUrlRequest in order to control particular HTTP headers in the service response from those service interfaces.

For example, a client could dynamically change the apparent Content-Disposition header of a single object, so that it appears to have a different file name for different callers. One client could be configured return the object with

 Content-Disposition: attachment; filename=FileName1.exe
 
while another could return that same object with headers
 Content-Disposition: attachment; filename=FileName2.pdf
 

 
 public class ResponseHeaderOverrides {
     private String contentType;
     private String contentLanguage;
     private String expires;
     private String cacheControl;
     private String contentDisposition;
     private String contentEncoding;
 
     public static final String RESPONSE_HEADER_CONTENT_TYPE = "response-content-type";
     public static final String RESPONSE_HEADER_CONTENT_LANGUAGE = "response-content-language";
     public static final String RESPONSE_HEADER_EXPIRES = "response-expires";
     public static final String RESPONSE_HEADER_CACHE_CONTROL = "response-cache-control";
     public static final String RESPONSE_HEADER_CONTENT_DISPOSITION = "response-content-disposition";
     public static final String RESPONSE_HEADER_CONTENT_ENCODING = "response-content-encoding";

    
The canonical order of parameters for consistent requests, here for reference only.
 
     @SuppressWarnings("unused")
     private static final String[] PARAMETER_ORDER = new String[] { ,
             , };

    
Returns the content type response header override if it has been specified, or null otherwise.

Returns:
Returns the content type response header override if it has been specified, or null otherwise.
See also:
RESPONSE_HEADER_CONTENT_TYPE
 
     public String getContentType() {
         return ;
     }

    
Sets the content type response header override.

 
     public void setContentType(String contentType) {
         this. = contentType;
     }

    
Sets the content type response header override.

Returns:
This ResponseHeaderOverrides object for method chaining.
See also:
RESPONSE_HEADER_CONTENT_TYPE
 
     public ResponseHeaderOverrides withContentType(String contentType) {
         setContentType(contentType);
         return this;
    }

    
Returns the content language response header override if it has been specified, or null otherwise.

Returns:
Returns the content language response header override if it has been specified, or null otherwise.
See also:
RESPONSE_HEADER_CONTENT_LANGUAGE
    public String getContentLanguage() {
        return ;
    }

    
Sets the content language response header override

    public void setContentLanguage(String contentLanguage) {
        this. = contentLanguage;
    }

    
Sets the content language response header override

Returns:
This ResponseHeaderOverrides object for method chaining.
See also:
RESPONSE_HEADER_CONTENT_LANGUAGE
    public ResponseHeaderOverrides withContentLanguage(String contentLanguage) {
        setContentLanguage(contentLanguage);
        return this;
    }

    
Returns the expires response header override if it has been specified, or null otherwise.

Returns:
Returns the expires response header override if it has been specified, or null otherwise.
See also:
RESPONSE_HEADER_EXPIRES
    public String getExpires() {
        return ;
    }

    
Sets the expires response header override.

    public void setExpires(String expires) {
        this. = expires;
    }

    
Sets the expires response header override.

Returns:
This ResponseHeaderOverrides object for method chaining.
See also:
RESPONSE_HEADER_EXPIRES
    public ResponseHeaderOverrides withExpires(String expires) {
        setExpires(expires);
        return this;
    }

    
Returns the cache control response header override if it has been specified, or null otherwise.

Returns:
Returns the cache control response header override if it has been specified, or null otherwise.
See also:
RESPONSE_HEADER_CACHE_CONTROL
    public String getCacheControl() {
        return ;
    }

    
Sets the cache control response header.

    public void setCacheControl(String cacheControl) {
        this. = cacheControl;
    }

    
Sets the cache control response header.

Returns:
This ResponseHeaderOverrides object for method chaining.
See also:
RESPONSE_HEADER_CACHE_CONTROL
    public ResponseHeaderOverrides withCacheControl(String cacheControl) {
        setCacheControl(cacheControl);
        return this;
    }

    
Returns the content disposition response header override if it has been specified, or null otherwise.

Returns:
Returns the content disposition response header override if it has been specified, or null otherwise.
See also:
RESPONSE_HEADER_CONTENT_DISPOSITION
    public String getContentDisposition() {
        return ;
    }

    
Sets the content disposition response header override.

    public void setContentDisposition(String contentDisposition) {
        this. = contentDisposition;
    }

    
Sets the content disposition response header override.

Returns:
This ResponseHeaderOverrides object for method chaining.
See also:
RESPONSE_HEADER_CONTENT_DISPOSITION
    public ResponseHeaderOverrides withContentDisposition(String contentDisposition) {
        setContentDisposition(contentDisposition);
        return this;
    }

    
Returns the content encoding response header override if it has been specified, or null otherwise.

Returns:
Returns the content encoding response header override if it has been specified, or null otherwise.
See also:
RESPONSE_HEADER_CONTENT_ENCODING
    public String getContentEncoding() {
        return ;
    }

    
Sets the content encoding response header override.

    public void setContentEncoding(String contentEncoding) {
        this. = contentEncoding;
    }

    
Sets the content encoding response header override.

Returns:
This ResponseHeaderOverrides object for method chaining.
See also:
RESPONSE_HEADER_CONTENT_ENCODING
    public ResponseHeaderOverrides withContentEncoding(String contentEncoding) {
        setContentEncoding(contentEncoding);
        return this;
    }
New to GrepCode? Check out our FAQ X