mirror of
https://github.com/dataease/dataease.git
synced 2026-06-12 16:31:11 +08:00
fix: 修复下载excel文件路径失效
This commit is contained in:
@@ -424,16 +424,16 @@ public class ExcelUtils {
|
||||
|
||||
private static Map<String, String> downLoadRemoteExcel(ExcelConfiguration remoteExcelRequest) throws DEException, FileNotFoundException {
|
||||
Map<String, String> fileNames = new HashMap<>();
|
||||
File p = new File(path);
|
||||
if (!p.exists()) {
|
||||
p.mkdirs();
|
||||
}
|
||||
if (remoteExcelRequest.getUrl().trim().startsWith("http")) {
|
||||
HttpClientConfig httpClientConfig = new HttpClientConfig();
|
||||
if (StringUtils.isNotEmpty(remoteExcelRequest.getUserName()) && StringUtils.isNotEmpty(remoteExcelRequest.getPasswd())) {
|
||||
String authValue = "Basic " + Base64.getUrlEncoder().encodeToString((remoteExcelRequest.getUserName() + ":" + remoteExcelRequest.getPasswd()).getBytes());
|
||||
httpClientConfig.addHeader("Authorization", authValue);
|
||||
}
|
||||
File p = new File(path);
|
||||
if (!p.exists()) {
|
||||
p.mkdirs();
|
||||
}
|
||||
fileNames = HttpClientUtil.downloadFile(remoteExcelRequest.getUrl(), httpClientConfig, path);
|
||||
} else if (remoteExcelRequest.getUrl().trim().startsWith("ftp")) {
|
||||
fileNames = downLoadFromFtp(remoteExcelRequest);
|
||||
|
||||
Reference in New Issue
Block a user