Java源码示例:org.lionsoul.ip2region.DbMakerConfigException

示例1
public IPTools() {
	try {
		File dbFile = new File(UKDataContext.getContext().getEnvironment().getProperty("web.upload-path"), "ipdata/ipdata.db") ;
		if(!dbFile.exists()){
			FileUtils.copyInputStreamToFile(IPTools.class.getClassLoader().getResourceAsStream(IP_DATA_PATH),dbFile);
		}
		_searcher = new DbSearcher(new DbConfig(),dbFile.getAbsolutePath());
	} catch (DbMakerConfigException | IOException e) {
		e.printStackTrace();
	} 
}