import org.dom4j.Element; //导入方法依赖的package包/类
/**
* 获取配置
*
* @param name
* @return
* @throws Exception
*/
public static HttpConfig getConfig(String name) throws Exception {
HttpConfig hc = CONFIG_MAP.get(name);
if (hc == null) {
SAXReader reader = new SAXReader();
File xml = new File(HTTP_CONFIG_FILE);
Document doc;
Element root;
if (xml.exists()) {
try (FileInputStream in = new FileInputStream(xml); Reader read = new InputStreamReader(in, “UTF-8”)) {
doc = reader.read(read);
root = doc.getRootElement();
List els = root.selectNodes(“/root/configs/config”);
for (Element el : els) {
String nameStr = el.attributeValue(“name”);
String encodeTy