Package cn.creekmoon.excel.util
Class ExcelFileUtils
java.lang.Object
cn.creekmoon.excel.util.ExcelFileUtils
获取路径
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcleanTempFileByPathDelay(String filePath) static voidcleanTempFileByPathDelay(String filePath, Integer fileLifeMinutes) static voidcleanTempFileByPathNow(String filePath) static StringgenerateXlsxAbsoluteFilePath(String uniqueId) 生成Xlsx文件绝对路径 默认路径在当前jar包的同级目录protected static Stringstatic StringgetCustomAbsoluteFilePath(String fileName) 获取获取一个文件路径 默认路径在当前jar包的同级目录protected static voidresponse(InputStream fileInputStream, String fileName, jakarta.servlet.http.HttpServletResponse response) static void返回Excel
-
Constructor Details
-
ExcelFileUtils
public ExcelFileUtils()
-
-
Method Details
-
generateXlsxAbsoluteFilePath
生成Xlsx文件绝对路径 默认路径在当前jar包的同级目录- Parameters:
uniqueId- 唯一名称,写文件完成后会获得- Returns:
-
getCustomAbsoluteFilePath
获取获取一个文件路径 默认路径在当前jar包的同级目录- Parameters:
fileName- 文件名称 需要自己保证不重复- Returns:
-
response
protected static void response(InputStream fileInputStream, String fileName, jakarta.servlet.http.HttpServletResponse response) throws IOException - Throws:
IOException
-
response
public static void response(String filePath, String fileName, jakarta.servlet.http.HttpServletResponse response) throws IOException 返回Excel- Parameters:
filePath- 本地文件路径fileName- 声明的文件名称,前端能看到 可以自己乱填response- servlet请求- Throws:
IOException
-
cleanTempFileByPathDelay
-
cleanTempFileByPathDelay
-
cleanTempFileByPathNow
-
getApplicationParentFilePath
-