public class DownloadUtil extends Object
| Constructor and Description |
|---|
DownloadUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
downloadExcelFile(String fileName,
List<List<Object>> datas)
下载excel
|
static void |
downloadFile(InputStream is,
long contentLength,
String fileName) |
static void |
downloadFile(InputStream is,
long contentLength,
String fileName,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
static void |
downloadFile(String filePath)
下载文件
|
static void |
downloadFile(String filePath,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
下载文件
|
static void |
downloadToFile(String fileName,
String contents)
下载内容到文件
|
static void |
downloadZipFile(List<File> srcFiles,
String srcRootDir,
String zipFileName)
下载压缩文件
|
static void |
setDownloadFileName(String fileName,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
设置下载文件名
|
public static void setDownloadFileName(String fileName, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws UnsupportedEncodingException
fileName - request - response - UnsupportedEncodingExceptionpublic static void downloadFile(String filePath)
filePath - public static void downloadFile(InputStream is, long contentLength, String fileName)
public static void downloadFile(String filePath, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
filePath - request - response - public static void downloadFile(InputStream is, long contentLength, String fileName, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
public static void downloadToFile(String fileName, String contents)
fileName - 下载文件名contents - 文件内容public static void downloadExcelFile(String fileName, List<List<Object>> datas)
fileName - datas - Copyright © 2025. All rights reserved.