From 9f0bc5779b57cc3faa10468e6abb07e82d231ac5 Mon Sep 17 00:00:00 2001 From: qi_liang Date: Wed, 15 May 2019 10:13:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9C=A8=E9=83=A8=E5=88=86?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E4=B8=8B=E6=97=A0=E6=B3=95=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E6=9F=A5=E6=89=BEclassBUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/lq/code/util/BeanUtil.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/lq/code/util/BeanUtil.java b/src/main/java/com/lq/code/util/BeanUtil.java index 71743d7..d38314c 100755 --- a/src/main/java/com/lq/code/util/BeanUtil.java +++ b/src/main/java/com/lq/code/util/BeanUtil.java @@ -19,6 +19,8 @@ public class BeanUtil { private static Logger LOGGER = LoggerFactory.getLogger(BeanUtil.class); + public static final String FILE_SYMBOL = "/"; + /** * 获取类属性,包括父类属性 * @param clazz @@ -165,7 +167,7 @@ public class BeanUtil { Set set = new HashSet<>(); String separator = File.separator; String filePath = packagePath.replace(".",separator); - String classPath = BeanUtil.class.getResource(separator).getPath()+filePath; + String classPath = BeanUtil.class.getResource(FILE_SYMBOL).getPath()+filePath; File file = new File(classPath); if (file.exists()){ File[] files = file.listFiles();