/** 项目在硬盘上的基础路径 */
private static final String PROJECT_PATH = System.getProperty("user.dir");
/** 获取当前类的路径 com.example.CodeGenerator.core*/
private static String packAge = ProjectConstant.class.getPackage().getName();
/** 根据路径切割最后一位名称获得当前类上一级路径 com.example.CodeGenerator*/
private static final String PACKAGE = packAge.substring(0,packAge.lastIndexOf("."));
/**
* 自定义方法
* 将获取到的包路径中的点号换成斜杠
* @param packageName 传入的包路径
* @return 路径前后都加上斜杠中间也替换成斜杠返回
*/
private static String packageConvertPath(String packageName) {
return String.format("/%s/", packageName.contains(".") ? packageName.replaceAll("\\.", "/") : packageName);
}