file.Dir变为选配置添加其默认值
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
package cn.keking.utils;
|
||||
|
||||
import cn.keking.config.ConfigConstants;
|
||||
import cn.keking.model.ReturnResponse;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
import java.io.*;
|
||||
import java.net.*;
|
||||
@ -13,8 +13,7 @@ import java.util.UUID;
|
||||
@Component
|
||||
public class DownloadUtils {
|
||||
|
||||
@Value("${file.dir}")
|
||||
String fileDir;
|
||||
String fileDir = ConfigConstants.getFileDir();
|
||||
|
||||
/**
|
||||
* 一开始测试的时候发现有些文件没有下载下来,而有些可以;当时也是郁闷了好一阵,但是最终还是不得解
|
||||
|
||||
@ -30,8 +30,7 @@ public class FileUtils {
|
||||
@Autowired
|
||||
CacheService cacheService;
|
||||
|
||||
@Value("${file.dir}")
|
||||
String fileDir;
|
||||
String fileDir = ConfigConstants.getFileDir();
|
||||
|
||||
@Value("${converted.file.charset}")
|
||||
String charset;
|
||||
|
||||
@ -1,12 +1,11 @@
|
||||
package cn.keking.utils;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import cn.keking.config.ConfigConstants;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class ShedulerClean {
|
||||
@Value("${file.dir}")
|
||||
String fileDir;
|
||||
String fileDir = ConfigConstants.getFileDir();
|
||||
|
||||
// @Scheduled(cron = "0 0 23 * * ?") //每晚23点执行一次
|
||||
public void clean(){
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
package cn.keking.utils;
|
||||
|
||||
import cn.keking.config.ConfigConstants;
|
||||
import cn.keking.model.ReturnResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
@ -12,8 +12,7 @@ import org.springframework.stereotype.Component;
|
||||
*/
|
||||
@Component
|
||||
public class SimTextUtil {
|
||||
@Value("${file.dir}")
|
||||
String fileDir;
|
||||
String fileDir = ConfigConstants.getFileDir();
|
||||
@Autowired
|
||||
DownloadUtils downloadUtils;
|
||||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package cn.keking.utils;
|
||||
|
||||
import cn.keking.config.ConfigConstants;
|
||||
import cn.keking.model.FileType;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
@ -11,7 +12,6 @@ import com.google.common.collect.Maps;
|
||||
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
|
||||
import org.apache.commons.compress.archivers.zip.ZipFile;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
|
||||
@ -36,8 +36,7 @@ public class ZipReader {
|
||||
|
||||
@Autowired
|
||||
FileUtils fileUtils;
|
||||
@Value("${file.dir}")
|
||||
String fileDir;
|
||||
String fileDir = ConfigConstants.getFileDir();
|
||||
|
||||
ExecutorService executors = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user