guohongjin
2024-05-15 5b7639f0bd9e056738ec15100ed0532e965c6cd5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package cn.stylefeng.roses.kernel.rule.util;
 
import java.util.regex.Pattern;
 
/**
 * 字符串过滤工具,主要过滤不合法的请求参数
 *
 * @author fengshuonan
 * @date 2022/9/19 13:37
 */
public class StrFilterUtil {
 
    /**
     * 过滤文件名
     *
     * @author fengshuonan
     * @date 2022/9/19 13:39
     */
    public static String filterFileName(String param) {
        Pattern fileNamePattern = Pattern.compile("[\\\\/:*?\"<>|\\s]");
        return fileNamePattern.matcher(param).replaceAll("");
    }
 
}