类 ResponseHeaderOverrides
- java.lang.Object
-
- com.baidubce.model.AbstractBceRequest
-
- com.baidubce.services.bos.model.ResponseHeaderOverrides
-
public class ResponseHeaderOverrides extends AbstractBceRequest
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 headersContent-Disposition: attachment; filename=FileName2.pdf
-
-
字段概要
字段 修饰符和类型 字段 说明 static StringRESPONSE_HEADER_CACHE_CONTROLstatic StringRESPONSE_HEADER_CONTENT_DISPOSITIONstatic StringRESPONSE_HEADER_CONTENT_ENCODINGstatic StringRESPONSE_HEADER_CONTENT_LANGUAGEstatic StringRESPONSE_HEADER_CONTENT_TYPEstatic StringRESPONSE_HEADER_EXPIRES
-
构造器概要
构造器 构造器 说明 ResponseHeaderOverrides()
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 StringgetCacheControl()Returns the cache control response header override if it has been specified, or null otherwise.StringgetContentDisposition()Returns the content disposition response header override if it has been specified, or null otherwise.StringgetContentEncoding()Returns the content encoding response header override if it has been specified, or null otherwise.StringgetContentLanguage()Returns the content language response header override if it has been specified, or null otherwise.StringgetContentType()Returns the content type response header override if it has been specified, or null otherwise.StringgetExpires()Returns the expires response header override if it has been specified, or null otherwise.voidsetCacheControl(String cacheControl)Sets the cache control response header.voidsetContentDisposition(String contentDisposition)Sets the content disposition response header override.voidsetContentEncoding(String contentEncoding)Sets the content encoding response header override.voidsetContentLanguage(String contentLanguage)Sets the content language response header overridevoidsetContentType(String contentType)Sets the content type response header override.voidsetExpires(String expires)Sets the expires response header override.ResponseHeaderOverrideswithCacheControl(String cacheControl)Sets the cache control response header.ResponseHeaderOverrideswithContentDisposition(String contentDisposition)Sets the content disposition response header override.ResponseHeaderOverrideswithContentEncoding(String contentEncoding)Sets the content encoding response header override.ResponseHeaderOverrideswithContentLanguage(String contentLanguage)Sets the content language response header overrideResponseHeaderOverrideswithContentType(String contentType)Sets the content type response header override.ResponseHeaderOverrideswithExpires(String expires)Sets the expires response header override.ResponseHeaderOverrideswithRequestCredentials(BceCredentials credentials)-
从类继承的方法 com.baidubce.model.AbstractBceRequest
getRequestCredentials, setRequestCredentials
-
-
-
-
方法详细资料
-
withRequestCredentials
public ResponseHeaderOverrides withRequestCredentials(BceCredentials credentials)
- 指定者:
withRequestCredentials在类中AbstractBceRequest
-
getContentType
public String getContentType()
Returns the content type response header override if it has been specified, or null otherwise.- 返回:
- Returns the content type response header override if it has been specified, or null otherwise.
- 另请参阅:
RESPONSE_HEADER_CONTENT_TYPE
-
setContentType
public void setContentType(String contentType)
Sets the content type response header override.- 参数:
contentType- the content type response header- 另请参阅:
RESPONSE_HEADER_CONTENT_TYPE
-
withContentType
public ResponseHeaderOverrides withContentType(String contentType)
Sets the content type response header override.- 参数:
contentType- the content type response header- 返回:
- This
ResponseHeaderOverridesobject for method chaining. - 另请参阅:
RESPONSE_HEADER_CONTENT_TYPE
-
getContentLanguage
public String getContentLanguage()
Returns the content language response header override if it has been specified, or null otherwise.- 返回:
- Returns the content language response header override if it has been specified, or null otherwise.
- 另请参阅:
RESPONSE_HEADER_CONTENT_LANGUAGE
-
setContentLanguage
public void setContentLanguage(String contentLanguage)
Sets the content language response header override- 参数:
contentLanguage- the content language response- 另请参阅:
RESPONSE_HEADER_CONTENT_LANGUAGE
-
withContentLanguage
public ResponseHeaderOverrides withContentLanguage(String contentLanguage)
Sets the content language response header override- 参数:
contentLanguage- the content language response- 返回:
- This
ResponseHeaderOverridesobject for method chaining. - 另请参阅:
RESPONSE_HEADER_CONTENT_LANGUAGE
-
getExpires
public String getExpires()
Returns the expires response header override if it has been specified, or null otherwise.- 返回:
- Returns the expires response header override if it has been specified, or null otherwise.
- 另请参阅:
RESPONSE_HEADER_EXPIRES
-
setExpires
public void setExpires(String expires)
Sets the expires response header override.- 参数:
expires- the expires response header- 另请参阅:
RESPONSE_HEADER_EXPIRES
-
withExpires
public ResponseHeaderOverrides withExpires(String expires)
Sets the expires response header override.- 参数:
expires- the expires response header- 返回:
- This
ResponseHeaderOverridesobject for method chaining. - 另请参阅:
RESPONSE_HEADER_EXPIRES
-
getCacheControl
public String getCacheControl()
Returns the cache control response header override if it has been specified, or null otherwise.- 返回:
- Returns the cache control response header override if it has been specified, or null otherwise.
- 另请参阅:
RESPONSE_HEADER_CACHE_CONTROL
-
setCacheControl
public void setCacheControl(String cacheControl)
Sets the cache control response header.- 参数:
cacheControl- the cache control response header- 另请参阅:
RESPONSE_HEADER_CACHE_CONTROL
-
withCacheControl
public ResponseHeaderOverrides withCacheControl(String cacheControl)
Sets the cache control response header.- 参数:
cacheControl- the cache control response header- 返回:
- This
ResponseHeaderOverridesobject for method chaining. - 另请参阅:
RESPONSE_HEADER_CACHE_CONTROL
-
getContentDisposition
public String getContentDisposition()
Returns the content disposition response header override if it has been specified, or null otherwise.- 返回:
- Returns the content disposition response header override if it has been specified, or null otherwise.
- 另请参阅:
RESPONSE_HEADER_CONTENT_DISPOSITION
-
setContentDisposition
public void setContentDisposition(String contentDisposition)
Sets the content disposition response header override.- 参数:
contentDisposition- the content disposition response header- 另请参阅:
RESPONSE_HEADER_CONTENT_DISPOSITION
-
withContentDisposition
public ResponseHeaderOverrides withContentDisposition(String contentDisposition)
Sets the content disposition response header override.- 参数:
contentDisposition- the content disposition response header- 返回:
- This
ResponseHeaderOverridesobject for method chaining. - 另请参阅:
RESPONSE_HEADER_CONTENT_DISPOSITION
-
getContentEncoding
public String getContentEncoding()
Returns the content encoding response header override if it has been specified, or null otherwise.- 返回:
- Returns the content encoding response header override if it has been specified, or null otherwise.
- 另请参阅:
RESPONSE_HEADER_CONTENT_ENCODING
-
setContentEncoding
public void setContentEncoding(String contentEncoding)
Sets the content encoding response header override.- 参数:
contentEncoding- the content encoding response header- 另请参阅:
RESPONSE_HEADER_CONTENT_ENCODING
-
withContentEncoding
public ResponseHeaderOverrides withContentEncoding(String contentEncoding)
Sets the content encoding response header override.- 参数:
contentEncoding- the content encoding response header- 返回:
- This
ResponseHeaderOverridesobject for method chaining. - 另请参阅:
RESPONSE_HEADER_CONTENT_ENCODING
-
-