62,614
社区成员
发帖
与我相关
我的任务
分享
public static String getTarget() throws ConfigurationException /*抛出异常?*/{
String target = "";
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
URL url = classLoader.getResource("org/seatore/resources/targetMachine.properties");
try /*捕获异常?*/{
Configuration config = new PropertiesConfiguration(url);
target = config.getString("target.ip");
logger.info("Connect to the machine:" + target);
}catch (ConfigurationException e) {
}
return target;
}