Package com.amazonaws.services.s3.model
Class ResponseHeaderOverrides
- java.lang.Object
-
- com.amazonaws.services.s3.model.ResponseHeaderOverrides
-
- All Implemented Interfaces:
Serializable
public class ResponseHeaderOverrides extends Object implements Serializable
Container object for overriding headers on aGetObjectRequest
orGeneratePresignedUrlRequest
response. Response headers can be set on aGetObjectRequest
or aGeneratePresignedUrlRequest
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 headersContent-Disposition: attachment; filename=FileName2.pdf
-
-
Field Summary
Fields Modifier and Type Field Description static String
RESPONSE_HEADER_CACHE_CONTROL
static String
RESPONSE_HEADER_CONTENT_DISPOSITION
static String
RESPONSE_HEADER_CONTENT_ENCODING
static String
RESPONSE_HEADER_CONTENT_LANGUAGE
static String
RESPONSE_HEADER_CONTENT_TYPE
static String
RESPONSE_HEADER_EXPIRES
-
Constructor Summary
Constructors Constructor Description ResponseHeaderOverrides()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getCacheControl()
Returns the cache control response header override if it has been specified, or null otherwise.String
getContentDisposition()
Returns the content disposition response header override if it has been specified, or null otherwise.String
getContentEncoding()
Returns the content encoding response header override if it has been specified, or null otherwise.String
getContentLanguage()
Returns the content language response header override if it has been specified, or null otherwise.String
getContentType()
Returns the content type response header override if it has been specified, or null otherwise.String
getExpires()
Returns the expires response header override if it has been specified, or null otherwise.void
setCacheControl(String cacheControl)
Sets the cache control response header.void
setContentDisposition(String contentDisposition)
Sets the content disposition response header override.void
setContentEncoding(String contentEncoding)
Sets the content encoding response header override.void
setContentLanguage(String contentLanguage)
Sets the content language response header overridevoid
setContentType(String contentType)
Sets the content type response header override.void
setExpires(String expires)
Sets the expires response header override.ResponseHeaderOverrides
withCacheControl(String cacheControl)
Sets the cache control response header.ResponseHeaderOverrides
withContentDisposition(String contentDisposition)
Sets the content disposition response header override.ResponseHeaderOverrides
withContentEncoding(String contentEncoding)
Sets the content encoding response header override.ResponseHeaderOverrides
withContentLanguage(String contentLanguage)
Sets the content language response header overrideResponseHeaderOverrides
withContentType(String contentType)
Sets the content type response header override.ResponseHeaderOverrides
withExpires(String expires)
Sets the expires response header override.
-
-
-
Field Detail
-
RESPONSE_HEADER_CONTENT_TYPE
public static final String RESPONSE_HEADER_CONTENT_TYPE
- See Also:
- Constant Field Values
-
RESPONSE_HEADER_CONTENT_LANGUAGE
public static final String RESPONSE_HEADER_CONTENT_LANGUAGE
- See Also:
- Constant Field Values
-
RESPONSE_HEADER_EXPIRES
public static final String RESPONSE_HEADER_EXPIRES
- See Also:
- Constant Field Values
-
RESPONSE_HEADER_CACHE_CONTROL
public static final String RESPONSE_HEADER_CACHE_CONTROL
- See Also:
- Constant Field Values
-
RESPONSE_HEADER_CONTENT_DISPOSITION
public static final String RESPONSE_HEADER_CONTENT_DISPOSITION
- See Also:
- Constant Field Values
-
RESPONSE_HEADER_CONTENT_ENCODING
public static final String RESPONSE_HEADER_CONTENT_ENCODING
- See Also:
- Constant Field Values
-
-
Method Detail
-
getContentType
public String getContentType()
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
-
setContentType
public void setContentType(String contentType)
Sets the content type response header override.- See Also:
RESPONSE_HEADER_CONTENT_TYPE
-
withContentType
public ResponseHeaderOverrides withContentType(String contentType)
Sets the content type response header override.- Returns:
- This
ResponseHeaderOverrides
object for method chaining. - See Also:
RESPONSE_HEADER_CONTENT_TYPE
-
getContentLanguage
public String getContentLanguage()
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
-
setContentLanguage
public void setContentLanguage(String contentLanguage)
Sets the content language response header override- See Also:
RESPONSE_HEADER_CONTENT_LANGUAGE
-
withContentLanguage
public ResponseHeaderOverrides withContentLanguage(String contentLanguage)
Sets the content language response header override- Returns:
- This
ResponseHeaderOverrides
object for method chaining. - See Also:
RESPONSE_HEADER_CONTENT_LANGUAGE
-
getExpires
public String getExpires()
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
-
setExpires
public void setExpires(String expires)
Sets the expires response header override.- See Also:
RESPONSE_HEADER_EXPIRES
-
withExpires
public ResponseHeaderOverrides withExpires(String expires)
Sets the expires response header override.- Returns:
- This
ResponseHeaderOverrides
object for method chaining. - See Also:
RESPONSE_HEADER_EXPIRES
-
getCacheControl
public String getCacheControl()
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
-
setCacheControl
public void setCacheControl(String cacheControl)
Sets the cache control response header.- See Also:
RESPONSE_HEADER_CACHE_CONTROL
-
withCacheControl
public ResponseHeaderOverrides withCacheControl(String cacheControl)
Sets the cache control response header.- Returns:
- This
ResponseHeaderOverrides
object for method chaining. - See Also:
RESPONSE_HEADER_CACHE_CONTROL
-
getContentDisposition
public String getContentDisposition()
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
-
setContentDisposition
public void setContentDisposition(String contentDisposition)
Sets the content disposition response header override.- See Also:
RESPONSE_HEADER_CONTENT_DISPOSITION
-
withContentDisposition
public ResponseHeaderOverrides withContentDisposition(String contentDisposition)
Sets the content disposition response header override.- Returns:
- This
ResponseHeaderOverrides
object for method chaining. - See Also:
RESPONSE_HEADER_CONTENT_DISPOSITION
-
getContentEncoding
public String getContentEncoding()
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
-
setContentEncoding
public void setContentEncoding(String contentEncoding)
Sets the content encoding response header override.- See Also:
RESPONSE_HEADER_CONTENT_ENCODING
-
withContentEncoding
public ResponseHeaderOverrides withContentEncoding(String contentEncoding)
Sets the content encoding response header override.- Returns:
- This
ResponseHeaderOverrides
object for method chaining. - See Also:
RESPONSE_HEADER_CONTENT_ENCODING
-
-