支持FTP文件地址作为预览源url

This commit is contained in:
陈精华
2019-06-19 14:18:09 +08:00
committed by kl
parent a78f1e5f8e
commit 37762cf034
11 changed files with 161 additions and 32 deletions

View File

@@ -1,6 +1,7 @@
package cn.keking.utils;
import cn.keking.config.ConfigConstants;
import cn.keking.model.FileAttribute;
import cn.keking.model.ReturnResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -12,12 +13,14 @@ import org.springframework.stereotype.Component;
*/
@Component
public class SimTextUtil {
String fileDir = ConfigConstants.getFileDir();
@Autowired
DownloadUtils downloadUtils;
private FileUtils fileUtils;
@Autowired
private DownloadUtils downloadUtils;
public ReturnResponse<String> readSimText(String url, String fileName){
ReturnResponse<String> response = downloadUtils.downLoad(url, "txt", fileName);
FileAttribute fileAttribute = fileUtils.getFileAttribute(url);
ReturnResponse<String> response = downloadUtils.downLoad(fileAttribute, fileName);
return response;
}
}