update 统一格式化代码结构

This commit is contained in:
疯狂的狮子li
2021-10-22 10:04:15 +08:00
parent 32bfe334c0
commit 336adbd056
54 changed files with 806 additions and 987 deletions

View File

@ -10,20 +10,18 @@ import java.nio.charset.StandardCharsets;
/**
* 文件处理工具类
*
* @author ruoyi
* @author Lion Li
*/
public class FileUtils extends FileUtil
{
public class FileUtils extends FileUtil {
/**
* 下载文件名重新编码
*
* @param response 响应对象
* @param response 响应对象
* @param realFileName 真实文件名
* @return
*/
public static void setAttachmentResponseHeader(HttpServletResponse response, String realFileName) throws UnsupportedEncodingException
{
public static void setAttachmentResponseHeader(HttpServletResponse response, String realFileName) throws UnsupportedEncodingException {
String percentEncodedFileName = percentEncode(realFileName);
StringBuilder contentDispositionValue = new StringBuilder();
@ -44,8 +42,7 @@ public class FileUtils extends FileUtil
* @param s 需要百分号编码的字符串
* @return 百分号编码后的字符串
*/
public static String percentEncode(String s) throws UnsupportedEncodingException
{
public static String percentEncode(String s) throws UnsupportedEncodingException {
String encode = URLEncoder.encode(s, StandardCharsets.UTF_8.toString());
return encode.replaceAll("\\+", "%20");
}