add method

This commit is contained in:
Looly
2021-10-18 16:54:25 +08:00
parent 644d1c22c7
commit e04789c322
2 changed files with 15 additions and 1 deletions

View File

@@ -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);
}
}