chore[class]: adjust code

This commit is contained in:
sun
2023-09-06 11:34:15 +08:00
parent f7b06a086e
commit f14488cdc8
2 changed files with 13 additions and 1 deletions
@@ -317,7 +317,9 @@ public abstract class ClassUtils {
* @param filePath 一般指resources中的文件,也可以在jar中
*/
public static InputStream getFileFromClassPath(String filePath) throws IOException {
return getDefaultClassLoader().getResource(filePath).openStream();
var classLoader = getDefaultClassLoader();
var resource = classLoader.getResource(filePath);
return resource.openStream();
}
public static String getFileFromClassPathToString(String filePath) {