@@ -119,7 +119,7 @@ private enum Modes {
119119 private boolean LASTSEEN_ENABLED ;
120120 private boolean THREAT_ENABLED ;
121121
122- private static final String _ModuleVersion = "3.0.1 " ;
122+ private static final String _ModuleVersion = "3.0.2 " ;
123123
124124 public IP2Proxy () {
125125
@@ -157,6 +157,7 @@ public String GetDatabaseVersion() {
157157/**
158158* This function returns ans integer to state if it proxy.
159159* @param IP IP Address you wish to query
160+ * @throws IOException If an input or output exception occurred
160161* @return -1 if error, 0 if not a proxy, 1 if proxy except DCH and SES, 2 if proxy and either DCH or SES
161162*/
162163 public int IsProxy (String IP ) throws IOException {
@@ -166,6 +167,7 @@ public int IsProxy(String IP) throws IOException {
166167/**
167168* This function returns the country code.
168169* @param IP IP Address you wish to query
170+ * @throws IOException If an input or output exception occurred
169171* @return Country code
170172*/
171173 public String GetCountryShort (String IP ) throws IOException {
@@ -175,6 +177,7 @@ public String GetCountryShort(String IP) throws IOException {
175177/**
176178* This function returns the country name.
177179* @param IP IP Address you wish to query
180+ * @throws IOException If an input or output exception occurred
178181* @return Country name
179182*/
180183 public String GetCountryLong (String IP ) throws IOException {
@@ -184,6 +187,7 @@ public String GetCountryLong(String IP) throws IOException {
184187/**
185188* This function returns the region name.
186189* @param IP IP Address you wish to query
190+ * @throws IOException If an input or output exception occurred
187191* @return Region name
188192*/
189193 public String GetRegion (String IP ) throws IOException {
@@ -193,6 +197,7 @@ public String GetRegion(String IP) throws IOException {
193197/**
194198* This function returns the city name.
195199* @param IP IP Address you wish to query
200+ * @throws IOException If an input or output exception occurred
196201* @return City name
197202*/
198203 public String GetCity (String IP ) throws IOException {
@@ -202,6 +207,7 @@ public String GetCity(String IP) throws IOException {
202207/**
203208* This function returns the ISP name.
204209* @param IP IP Address you wish to query
210+ * @throws IOException If an input or output exception occurred
205211* @return ISP name
206212*/
207213 public String GetISP (String IP ) throws IOException {
@@ -211,6 +217,7 @@ public String GetISP(String IP) throws IOException {
211217/**
212218* This function returns the proxy type.
213219* @param IP IP Address you wish to query
220+ * @throws IOException If an input or output exception occurred
214221* @return Proxy type
215222*/
216223 public String GetProxyType (String IP ) throws IOException {
@@ -220,6 +227,7 @@ public String GetProxyType(String IP) throws IOException {
220227/**
221228* This function returns the domain.
222229* @param IP IP Address you wish to query
230+ * @throws IOException If an input or output exception occurred
223231* @return Domain
224232*/
225233 public String GetDomain (String IP ) throws IOException {
@@ -229,6 +237,7 @@ public String GetDomain(String IP) throws IOException {
229237/**
230238* This function returns the usage type.
231239* @param IP IP Address you wish to query
240+ * @throws IOException If an input or output exception occurred
232241* @return Proxy type
233242*/
234243 public String GetUsageType (String IP ) throws IOException {
@@ -238,6 +247,7 @@ public String GetUsageType(String IP) throws IOException {
238247/**
239248* This function returns the Autonomous System Number.
240249* @param IP IP Address you wish to query
250+ * @throws IOException If an input or output exception occurred
241251* @return Autonomous System Number
242252*/
243253 public String GetASN (String IP ) throws IOException {
@@ -247,6 +257,7 @@ public String GetASN(String IP) throws IOException {
247257/**
248258* This function returns the Autonomous System name.
249259* @param IP IP Address you wish to query
260+ * @throws IOException If an input or output exception occurred
250261* @return Autonomous System name
251262*/
252263 public String GetAS (String IP ) throws IOException {
@@ -256,6 +267,7 @@ public String GetAS(String IP) throws IOException {
256267/**
257268* This function returns number of days the proxy was last seen.
258269* @param IP IP Address you wish to query
270+ * @throws IOException If an input or output exception occurred
259271* @return Number of days last seen
260272*/
261273 public String GetLastSeen (String IP ) throws IOException {
@@ -265,6 +277,7 @@ public String GetLastSeen(String IP) throws IOException {
265277/**
266278* This function returns the threat type of the proxy.
267279* @param IP IP Address you wish to query
280+ * @throws IOException If an input or output exception occurred
268281* @return Threat type of the proxy
269282*/
270283 public String GetThreat (String IP ) throws IOException {
@@ -274,6 +287,7 @@ public String GetThreat(String IP) throws IOException {
274287/**
275288* This function returns proxy result.
276289* @param IP IP Address you wish to query
290+ * @throws IOException If an input or output exception occurred
277291* @return Proxy result
278292*/
279293 public ProxyResult GetAll (String IP ) throws IOException {
@@ -282,6 +296,7 @@ public ProxyResult GetAll(String IP) throws IOException {
282296
283297/**
284298* This function destroys the mapped bytes.
299+ * @return 0 to indicate no errors
285300*/
286301 public int Close () {
287302 DestroyMappedBytes ();
@@ -449,13 +464,20 @@ private boolean LoadBIN() throws IOException {
449464/**
450465* This function initialize the component with the BIN file path and IO mode.
451466* @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
453468* @return -1 if encounter error else 0
454469*/
455470 public int Open (String DatabasePath ) throws IOException {
456471 return Open (DatabasePath , IOModes .IP2PROXY_FILE_IO );
457472 }
458473
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+ */
459481 public int Open (String DatabasePath , IOModes IOMode ) throws IOException {
460482 if (_DBType == 0 ) {
461483 _IPDatabasePath = DatabasePath ;
@@ -479,6 +501,7 @@ public int Open(String DatabasePath, IOModes IOMode) throws IOException {
479501/**
480502* This function to query IP2Proxy data.
481503* @param IPAddress IP Address you wish to query
504+ * @throws IOException If an input or output exception occurred
482505* @return IP2Proxy data
483506*/
484507 public ProxyResult ProxyQuery (String IPAddress ) throws IOException {
0 commit comments