File tree Expand file tree Collapse file tree 2 files changed +20
-3
lines changed
Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change 3636* <p>
3737*
3838* @author IP2Location.com
39- * @version 8.3 .0
39+ * @version 8.4 .0
4040*/
4141public class IP2Location {
4242 private static final Pattern pattern = Pattern .compile ("^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\ .){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$" ); // IPv4
@@ -145,6 +145,23 @@ public IP2Location() {
145145
146146 }
147147
148+
149+ /**
150+ * This function can be used to pre-load the BIN file.
151+ */
152+ public void Open (String DBPath ) throws IOException {
153+ IPDatabasePath = DBPath ;
154+ LoadBIN ();
155+ }
156+
157+ /**
158+ * This function can be used to initialized the component with params and pre-load the BIN file.
159+ */
160+ public void Open (String DBPath , boolean UseMMF ) throws IOException {
161+ UseMemoryMappedFile = UseMMF ;
162+ Open (DBPath );
163+ }
164+
148165 /**
149166 * This function destroys the mapped bytes.
150167 */
Original file line number Diff line number Diff line change 99* <p>
1010*
1111* @author IP2Location.com
12- * @version 8.3 .0
12+ * @version 8.4 .0
1313*/
1414public class IPResult {
1515 static final String NOT_SUPPORTED = "Not_Supported" ;
@@ -36,7 +36,7 @@ public class IPResult {
3636 String usagetype ;
3737 String status ;
3838 boolean delay =false ;
39- String version = "Version 8.3 .0" ;
39+ String version = "Version 8.4 .0" ;
4040 IPResult (String ipstring ) {
4141 ip_address = ipstring ;
4242 }
You can’t perform that action at this time.
0 commit comments