|
|
@@ -52,23 +52,21 @@ public class FileUploadTemplate {
|
|
|
|
|
|
public InputStream downloadFile(String fileName){
|
|
|
|
|
|
- String newfileName = ROOT_PATH+ fileName;
|
|
|
-
|
|
|
InputStream inputStream = null;
|
|
|
|
|
|
String ossSwitch = MappingCache.getValue(OSSUtil.DOMAIN, OSSUtil.OSS_SWITCH);
|
|
|
|
|
|
if (OSSUtil.OSS_SWITCH_OSS.equals(ossSwitch)) {
|
|
|
- inputStream = ossUploadTemplate.download(newfileName);
|
|
|
+ inputStream = ossUploadTemplate.download(fileName);
|
|
|
} else if (COSUtil.COS_SWITCH_COS.equals(ossSwitch)) {
|
|
|
- inputStream = cosUploadTemplate.download(newfileName);
|
|
|
+ inputStream = cosUploadTemplate.download(fileName);
|
|
|
} else {
|
|
|
String ftpServer = MappingCache.getValue(FtpUploadTemplate.FTP_DOMAIN, FtpUploadTemplate.FTP_SERVER);
|
|
|
int ftpPort = Integer.parseInt(MappingCache.getValue(FtpUploadTemplate.FTP_DOMAIN, FtpUploadTemplate.FTP_PORT));
|
|
|
String ftpUserName = MappingCache.getValue(FtpUploadTemplate.FTP_DOMAIN, FtpUploadTemplate.FTP_USERNAME);
|
|
|
String ftpUserPassword = MappingCache.getValue(FtpUploadTemplate.FTP_DOMAIN, FtpUploadTemplate.FTP_USERPASSWORD);
|
|
|
|
|
|
- inputStream = ftpUploadTemplate.download(newfileName, ftpServer,
|
|
|
+ inputStream = ftpUploadTemplate.download(fileName, ftpServer,
|
|
|
ftpPort, ftpUserName,
|
|
|
ftpUserPassword);
|
|
|
}
|