新功能点:所有配置项支持从环境变量里读取,方便Docker镜像部署

This commit is contained in:
陈精华
2019-10-25 13:59:29 +08:00
committed by kl
parent 8fdf462c6c
commit fa7241bd4e
6 changed files with 75 additions and 48 deletions

View File

@@ -25,6 +25,9 @@ import java.util.Map;
*/
@Component
public class FileUtils {
public static final String DEFAULT_CONVERTER_CHARSET = System.getProperty("sun.jnu.encoding");
Logger log= LoggerFactory.getLogger(getClass());
@Autowired
@@ -233,9 +236,8 @@ public class FileUtils {
*/
public void doActionConvertedFile(String outFilePath) {
StringBuffer sb = new StringBuffer();
String charset = ConfigConstants.getConvertedFileCharset();
try (InputStream inputStream = new FileInputStream(outFilePath);
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, charset))){
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, DEFAULT_CONVERTER_CHARSET))){
String line;
while(null != (line = reader.readLine())){
if (line.contains("charset=gb2312")) {