log.info("开始从classes/config/fixflowconfig.xml目录加载fixflowconfig.xml文件");
}
URL url = this.getClass().getClassLoader().getResource(classPath);
if(url == null){
log.error("未能从{}目录下找到fixflowconfig.xml文件",classPath);
throw new FixFlowClassLoadingException(ExceptionCode.CLASSLOAD_EXCEPTION_FILENOTFOUND ,"fixflowconfig.xml");
}
String filePath = url.toString();
Resource resource = null;
try {
if (!filePath.startsWith("jar")) {
filePath = java.net.URLDecoder.decode(ReflectUtil.getResource(classPath).getFile(), "utf-8");
resource = resourceSet.createResource(URI.createFileURI(filePath));
} else {
resource = resourceSet.createResource(URI.createURI(filePath));
}
resourceSet.getPackageRegistry().put(CoreconfigPackage.eINSTANCE.getNsURI(), CoreconfigPackage.eINSTANCE);
resource.load(null);
} catch (Exception e) {
log.error("fixflowconfig.xml文件加载失败", e);
throw new FixFlowClassLoadingException(ExceptionCode.CLASSLOAD_EXCEPTION,"fixflowconfig.xml", e);
}
fixFlowConfig = (FixFlowConfig) resource.getContents().get(0);
String versionString = fixFlowConfig.getVersion();
this.fixFlowVersion = new FixFlowVersion(versionString);
}