查询IP归属地 @param ip IP地址 @return
(String ip)
| 115 | * @return |
| 116 | */ |
| 117 | public static String queryAddress(String ip){ |
| 118 | if(searcher != null){ |
| 119 | try { |
| 120 | |
| 121 | return format(searcher.search(ip)); |
| 122 | } catch (Exception e) { |
| 123 | // TODO Auto-generated catch block |
| 124 | // e.printStackTrace(); |
| 125 | if (logger.isErrorEnabled()) { |
| 126 | logger.error("IP地址查询错误",e); |
| 127 | } |
| 128 | } |
| 129 | } |
| 130 | return ""; |
| 131 | } |
| 132 | |
| 133 | /** |
| 134 | * 查询省份IP归属地 |
no test coverage detected