chore[class]: adjust code

This commit is contained in:
sun committed 2023-09-06 11:34:15 +08:00
1 parent f7b06a086e
commit f14488cdc8
2 files changed
+13 -1

No files matched your search

@@ -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) {