mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
add method
This commit is contained in:
@@ -45,6 +45,7 @@ public enum ContentType {
|
||||
|
||||
/**
|
||||
* 构造
|
||||
*
|
||||
* @param value ContentType值
|
||||
*/
|
||||
ContentType(String value) {
|
||||
@@ -141,4 +142,16 @@ public enum ContentType {
|
||||
public static String build(String contentType, Charset charset) {
|
||||
return StrUtil.format("{};charset={}", contentType, charset.name());
|
||||
}
|
||||
|
||||
/**
|
||||
* 输出Content-Type字符串,附带编码信息
|
||||
*
|
||||
* @param contentType Content-Type 枚举类型
|
||||
* @param charset 编码
|
||||
* @return Content-Type字符串
|
||||
* @since 5.7.15
|
||||
*/
|
||||
public static String build(ContentType contentType, Charset charset) {
|
||||
return build(contentType.getValue(), charset);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user