修复在部分系统下无法自动查找classBUG

master
星期八 6 years ago
parent 18cece41b4
commit 9f0bc5779b
  1. 4
      src/main/java/com/lq/code/util/BeanUtil.java

@ -19,6 +19,8 @@ public class BeanUtil {
private static Logger LOGGER = LoggerFactory.getLogger(BeanUtil.class); private static Logger LOGGER = LoggerFactory.getLogger(BeanUtil.class);
public static final String FILE_SYMBOL = "/";
/** /**
* 获取类属性包括父类属性 * 获取类属性包括父类属性
* @param clazz * @param clazz
@ -165,7 +167,7 @@ public class BeanUtil {
Set<Class> set = new HashSet<>(); Set<Class> set = new HashSet<>();
String separator = File.separator; String separator = File.separator;
String filePath = packagePath.replace(".",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); File file = new File(classPath);
if (file.exists()){ if (file.exists()){
File[] files = file.listFiles(); File[] files = file.listFiles();

Loading…
Cancel
Save