|
@@ -899,5 +899,19 @@ public class FileUtils {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * utf-8格式读取文件,若文件不存在或者读取文件异常,返回null
|
|
|
|
+ * @param path
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public static String readUtf8String(String path){
|
|
|
|
+ try {
|
|
|
|
+ return FileUtil.readUtf8String(path);
|
|
|
|
+ }catch (Exception e){
|
|
|
|
+ log.warn("读取文件失败,path:{}", path);
|
|
|
|
+ }
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
}
|
|
}
|