diff --git a/cloud-common/src/main/java/com/cm/common/utils/ResourceUtil.java b/cloud-common/src/main/java/com/cm/common/utils/ResourceUtil.java index 012e15b..a075f49 100644 --- a/cloud-common/src/main/java/com/cm/common/utils/ResourceUtil.java +++ b/cloud-common/src/main/java/com/cm/common/utils/ResourceUtil.java @@ -26,6 +26,18 @@ public class ResourceUtil { return resourceLoader.getResource(resourcePath).getInputStream(); } + /** + * 资源文件 + * + * @param resourcePath + * @return + * @throws IOException + */ + public static File getResourceFile(String resourcePath) throws IOException { + ResourceLoader resourceLoader = new DefaultResourceLoader(); + return resourceLoader.getResource(resourcePath).getFile(); + } + /** * 输入流输出文本 *