We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 65cb55b commit 7010c9cCopy full SHA for 7010c9c
1 file changed
IP.java
@@ -58,6 +58,20 @@ public static void load(String filename) {
58
}
59
60
61
+ public static void load(String filename, boolean strict) throws Exception {
62
+ ipFile = new File(filename);
63
+ if (strict) {
64
+ int contentLength = Long.valueOf(ipFile.length()).intValue();
65
+ if (contentLength < 512 * 1024) {
66
+ throw new Exception("ip data file error.");
67
+ }
68
69
+ load();
70
+ if (enableFileWatch) {
71
+ watch();
72
73
74
+
75
public static String[] find(String ip) {
76
int ip_prefix_value = new Integer(ip.substring(0, ip.indexOf(".")));
77
long ip2long_value = ip2long(ip);
0 commit comments