public class IP2Location extends Object
Example usage scenarios:
Copyright (c) 2002-2023 IP2Location.com
| Modifier and Type | Field and Description |
|---|---|
String |
IPDatabasePath
Sets the path for the BIN database (IPv4 BIN or IPv4+IPv6 BIN).
|
String |
IPLicensePath
Sets the path for the license key file.
|
boolean |
UseMemoryMappedFile
To use memory mapped file for faster queries, set to true.
|
| Constructor and Description |
|---|
IP2Location() |
| Modifier and Type | Method and Description |
|---|---|
void |
Close()
This function destroys the mapped bytes.
|
protected void |
finalize()
Deprecated.
|
IPResult |
IPQuery(String IPAddress)
This function to query IP2Location data.
|
void |
Open(byte[] db) |
void |
Open(String DBPath)
This function can be used to pre-load the BIN file.
|
void |
Open(String DBPath,
boolean UseMMF)
This function can be used to initialize the component with params and pre-load the BIN file.
|
public boolean UseMemoryMappedFile
public String IPDatabasePath
public String IPLicensePath
public void Open(String DBPath) throws IOException
DBPath - The full path to the IP2Location BIN database fileIOException - If an input or output exception occurredpublic void Open(String DBPath, boolean UseMMF) throws IOException
DBPath - The full path to the IP2Location BIN database fileUseMMF - Set to true to load the BIN database file into memory mapped fileIOException - If an input or output exception occurredpublic void Open(byte[] db)
throws IOException
IOExceptionpublic void Close()
protected void finalize()
throws Throwable
public IPResult IPQuery(String IPAddress) throws IOException
IPAddress - IP Address you wish to queryIOException - If an input or output exception occurredCopyright © 2017–2023. All rights reserved.