package com.scg.utils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.mail.internet.MimeUtility;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.net.URLEncoder;
public class DownloadUtil {
private static final Logger logger = LoggerFactory.getLogger(DownloadUtil.class);
/**
*
* 方法说明:excel文件下载
*
* @param filePath
* 文件路径
* @param response
* @param fileName
* 保存文件时默认名称
* @return
* @throws Exception
*/
public static void downLoadFile(String filePath, HttpServletRequest request,
HttpServletResponse response, String fileName, String fileType) throws Exception {
logger.info("DownloadUtil.downLoadFile(filePath: {}, fileName: {})",
new Object