Class ExcelFileUtils

java.lang.Object
cn.creekmoon.excel.util.ExcelFileUtils

public class ExcelFileUtils extends Object
获取路径
  • Constructor Details

    • ExcelFileUtils

      public ExcelFileUtils()
  • Method Details

    • generateXlsxAbsoluteFilePath

      public static String generateXlsxAbsoluteFilePath(String uniqueId)
      生成Xlsx文件绝对路径 默认路径在当前jar包的同级目录
      Parameters:
      uniqueId - 唯一名称,写文件完成后会获得
      Returns:
    • getCustomAbsoluteFilePath

      public static String getCustomAbsoluteFilePath(String fileName)
      获取获取一个文件路径 默认路径在当前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

      public static void cleanTempFileByPathDelay(String filePath)
    • cleanTempFileByPathDelay

      public static void cleanTempFileByPathDelay(String filePath, Integer fileLifeMinutes)
    • cleanTempFileByPathNow

      public static void cleanTempFileByPathNow(String filePath)
    • getApplicationParentFilePath

      protected static String getApplicationParentFilePath()