From d8c54d81db667fec2410d82d89376b4297cac6f8 Mon Sep 17 00:00:00 2001 From: wenc000 <450292408@qq.com> Date: Tue, 16 Jun 2020 22:11:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=AF=BB=E5=8F=96=E8=B5=84?= =?UTF-8?q?=E6=BA=90=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/cm/common/utils/ResourceUtil.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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(); + } + /** * 输入流输出文本 *