public class HttpHeaderUtil extends Object
Modifier and Type | Class and Description |
---|---|
static class |
HttpHeaderUtil.ExtendedValue
根据rfc5987的扩展值,格式为:
编码'语言'值
|
Constructor and Description |
---|
HttpHeaderUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
createAttachmentDisposition(String fileName,
Charset charset)
生成Content-Disposition头,用于下载文件
格式为:
attachment;filename="example.txt";filename*=UTF-8''example.txt
|
static String |
getFileNameFromDisposition(Map<String,List<String>> headers,
String paramName)
从Content-Disposition头中获取文件名。
|
static List<String> |
headerList(Map<String,List<String>> headers,
String name)
根据name获取对应的头信息列表
|
public static List<String> headerList(Map<String,List<String>> headers, String name)
headers
- 头列表name
- Header名public static String createAttachmentDisposition(String fileName, Charset charset)
attachment;filename="example.txt";filename*=UTF-8''example.txt
fileName
- 文件名charset
- 编码public static String getFileNameFromDisposition(Map<String,List<String>> headers, String paramName)
headers
- 头列表paramName
- 文件参数名,如果为null
则使用默认的`filename`Copyright © 2025. All rights reserved.