Merge pull request #454 from lionsoul2014/fr_java_config_builder_assert
assert the builder data source args to avoid errors like reported on…
This commit is contained in:
commit
3d21a8247c
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
<groupId>org.lionsoul</groupId>
|
<groupId>org.lionsoul</groupId>
|
||||||
<artifactId>ip2region</artifactId>
|
<artifactId>ip2region</artifactId>
|
||||||
<version>3.3.4</version>
|
<version>3.3.5</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>ip2region</name>
|
<name>ip2region</name>
|
||||||
|
|
|
||||||
|
|
@ -49,16 +49,19 @@ public class ConfigBuilder {
|
||||||
}
|
}
|
||||||
|
|
||||||
public ConfigBuilder setXdbPath(String xdbPath) {
|
public ConfigBuilder setXdbPath(String xdbPath) {
|
||||||
|
assert xdbPath != null && xdbPath.length() > 0;
|
||||||
this.xdbPath = xdbPath;
|
this.xdbPath = xdbPath;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ConfigBuilder setXdbFile(File xdbFile) {
|
public ConfigBuilder setXdbFile(File xdbFile) {
|
||||||
|
assert xdbFile != null;
|
||||||
this.xdbFile = xdbFile;
|
this.xdbFile = xdbFile;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ConfigBuilder setXdbInputStream(InputStream xdbInputStream) {
|
public ConfigBuilder setXdbInputStream(InputStream xdbInputStream) {
|
||||||
|
assert xdbInputStream != null;
|
||||||
this.xdbInputStream = xdbInputStream;
|
this.xdbInputStream = xdbInputStream;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue