@@ -119,7 +119,7 @@ private enum Modes {
119
119
private boolean LASTSEEN_ENABLED ;
120
120
private boolean THREAT_ENABLED ;
121
121
122
- private static final String _ModuleVersion = "3.0.1 " ;
122
+ private static final String _ModuleVersion = "3.0.2 " ;
123
123
124
124
public IP2Proxy () {
125
125
@@ -157,6 +157,7 @@ public String GetDatabaseVersion() {
157
157
/**
158
158
* This function returns ans integer to state if it proxy.
159
159
* @param IP IP Address you wish to query
160
+ * @throws IOException If an input or output exception occurred
160
161
* @return -1 if error, 0 if not a proxy, 1 if proxy except DCH and SES, 2 if proxy and either DCH or SES
161
162
*/
162
163
public int IsProxy (String IP ) throws IOException {
@@ -166,6 +167,7 @@ public int IsProxy(String IP) throws IOException {
166
167
/**
167
168
* This function returns the country code.
168
169
* @param IP IP Address you wish to query
170
+ * @throws IOException If an input or output exception occurred
169
171
* @return Country code
170
172
*/
171
173
public String GetCountryShort (String IP ) throws IOException {
@@ -175,6 +177,7 @@ public String GetCountryShort(String IP) throws IOException {
175
177
/**
176
178
* This function returns the country name.
177
179
* @param IP IP Address you wish to query
180
+ * @throws IOException If an input or output exception occurred
178
181
* @return Country name
179
182
*/
180
183
public String GetCountryLong (String IP ) throws IOException {
@@ -184,6 +187,7 @@ public String GetCountryLong(String IP) throws IOException {
184
187
/**
185
188
* This function returns the region name.
186
189
* @param IP IP Address you wish to query
190
+ * @throws IOException If an input or output exception occurred
187
191
* @return Region name
188
192
*/
189
193
public String GetRegion (String IP ) throws IOException {
@@ -193,6 +197,7 @@ public String GetRegion(String IP) throws IOException {
193
197
/**
194
198
* This function returns the city name.
195
199
* @param IP IP Address you wish to query
200
+ * @throws IOException If an input or output exception occurred
196
201
* @return City name
197
202
*/
198
203
public String GetCity (String IP ) throws IOException {
@@ -202,6 +207,7 @@ public String GetCity(String IP) throws IOException {
202
207
/**
203
208
* This function returns the ISP name.
204
209
* @param IP IP Address you wish to query
210
+ * @throws IOException If an input or output exception occurred
205
211
* @return ISP name
206
212
*/
207
213
public String GetISP (String IP ) throws IOException {
@@ -211,6 +217,7 @@ public String GetISP(String IP) throws IOException {
211
217
/**
212
218
* This function returns the proxy type.
213
219
* @param IP IP Address you wish to query
220
+ * @throws IOException If an input or output exception occurred
214
221
* @return Proxy type
215
222
*/
216
223
public String GetProxyType (String IP ) throws IOException {
@@ -220,6 +227,7 @@ public String GetProxyType(String IP) throws IOException {
220
227
/**
221
228
* This function returns the domain.
222
229
* @param IP IP Address you wish to query
230
+ * @throws IOException If an input or output exception occurred
223
231
* @return Domain
224
232
*/
225
233
public String GetDomain (String IP ) throws IOException {
@@ -229,6 +237,7 @@ public String GetDomain(String IP) throws IOException {
229
237
/**
230
238
* This function returns the usage type.
231
239
* @param IP IP Address you wish to query
240
+ * @throws IOException If an input or output exception occurred
232
241
* @return Proxy type
233
242
*/
234
243
public String GetUsageType (String IP ) throws IOException {
@@ -238,6 +247,7 @@ public String GetUsageType(String IP) throws IOException {
238
247
/**
239
248
* This function returns the Autonomous System Number.
240
249
* @param IP IP Address you wish to query
250
+ * @throws IOException If an input or output exception occurred
241
251
* @return Autonomous System Number
242
252
*/
243
253
public String GetASN (String IP ) throws IOException {
@@ -247,6 +257,7 @@ public String GetASN(String IP) throws IOException {
247
257
/**
248
258
* This function returns the Autonomous System name.
249
259
* @param IP IP Address you wish to query
260
+ * @throws IOException If an input or output exception occurred
250
261
* @return Autonomous System name
251
262
*/
252
263
public String GetAS (String IP ) throws IOException {
@@ -256,6 +267,7 @@ public String GetAS(String IP) throws IOException {
256
267
/**
257
268
* This function returns number of days the proxy was last seen.
258
269
* @param IP IP Address you wish to query
270
+ * @throws IOException If an input or output exception occurred
259
271
* @return Number of days last seen
260
272
*/
261
273
public String GetLastSeen (String IP ) throws IOException {
@@ -265,6 +277,7 @@ public String GetLastSeen(String IP) throws IOException {
265
277
/**
266
278
* This function returns the threat type of the proxy.
267
279
* @param IP IP Address you wish to query
280
+ * @throws IOException If an input or output exception occurred
268
281
* @return Threat type of the proxy
269
282
*/
270
283
public String GetThreat (String IP ) throws IOException {
@@ -274,6 +287,7 @@ public String GetThreat(String IP) throws IOException {
274
287
/**
275
288
* This function returns proxy result.
276
289
* @param IP IP Address you wish to query
290
+ * @throws IOException If an input or output exception occurred
277
291
* @return Proxy result
278
292
*/
279
293
public ProxyResult GetAll (String IP ) throws IOException {
@@ -282,6 +296,7 @@ public ProxyResult GetAll(String IP) throws IOException {
282
296
283
297
/**
284
298
* This function destroys the mapped bytes.
299
+ * @return 0 to indicate no errors
285
300
*/
286
301
public int Close () {
287
302
DestroyMappedBytes ();
@@ -449,13 +464,20 @@ private boolean LoadBIN() throws IOException {
449
464
/**
450
465
* This function initialize the component with the BIN file path and IO mode.
451
466
* @param DatabasePath Path to the BIN database file
452
- * @param IOMode Default is file IO
467
+ * @throws IOException If an input or output exception occurred
453
468
* @return -1 if encounter error else 0
454
469
*/
455
470
public int Open (String DatabasePath ) throws IOException {
456
471
return Open (DatabasePath , IOModes .IP2PROXY_FILE_IO );
457
472
}
458
473
474
+ /**
475
+ * This function initialize the component with the BIN file path and IO mode.
476
+ * @param DatabasePath Path to the BIN database file
477
+ * @param IOMode Default is file IO
478
+ * @throws IOException If an input or output exception occurred
479
+ * @return -1 if encounter error else 0
480
+ */
459
481
public int Open (String DatabasePath , IOModes IOMode ) throws IOException {
460
482
if (_DBType == 0 ) {
461
483
_IPDatabasePath = DatabasePath ;
@@ -479,6 +501,7 @@ public int Open(String DatabasePath, IOModes IOMode) throws IOException {
479
501
/**
480
502
* This function to query IP2Proxy data.
481
503
* @param IPAddress IP Address you wish to query
504
+ * @throws IOException If an input or output exception occurred
482
505
* @return IP2Proxy data
483
506
*/
484
507
public ProxyResult ProxyQuery (String IPAddress ) throws IOException {
0 commit comments