fix:修复读取中文路径文件异常
This commit is contained in:
@@ -6,6 +6,7 @@ import cn.edu.scau.biubiusuisui.log.IFXPlusLogger;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.URL;
|
||||
import java.net.URLDecoder;
|
||||
|
||||
/**
|
||||
* @author jack
|
||||
@@ -34,7 +35,7 @@ public class FileUtil {
|
||||
* @return
|
||||
* @description 读取resources文件夹下的file,相对于resources的文件路径,如 resources/config.conf 则只需 config.conf
|
||||
*/
|
||||
public static String readFileFromResources(String filePath) {
|
||||
public static String readFileFromResources(String filePath) throws UnsupportedEncodingException {
|
||||
URL url = FileUtil.class.getClassLoader().getResource(filePath);
|
||||
if (url != null) {
|
||||
String path = StringUtil.getRootPath(url);
|
||||
|
||||
Reference in New Issue
Block a user