Skip to content

Commit dca495c

Browse files
committed
updating build,links for maven and gradle in ready.
1 parent 96ecdfe commit dca495c

File tree

5 files changed

+36
-20
lines changed

5 files changed

+36
-20
lines changed

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,29 @@ A simple to use Java library for the freely available DB-IP [IP address to city
55
#Before you begin
66
The entire dataset is loaded into a [TreeMap](https://docs.oracle.com/javase/8/docs/api/allclasses-noframe.html) . Make sure that you have about **3 GB of Heap space** available to load it.
77

8+
#Get
9+
10+
With maven :
11+
12+
```xml
13+
14+
<dependency>
15+
<groupId>in.ankushs</groupId>
16+
<artifactId>Java-DB-IP</artifactId>
17+
<version>1.0</version>
18+
</dependency>
19+
```
20+
21+
Or gradle:
22+
23+
```groovy
24+
25+
compile('in.ankushs:Java-DB-IP:1.0')
26+
27+
```
28+
29+
The Javadocs for the latest release can be found [here](http://www.javadoc.io/doc/in.ankushs/Java-DB-IP/1.0)
30+
831

932
#Instructions
1033
In order to get geographical information for an ip address, just pass the `dbip-city-latest.csv.gz` as a File object to `DbIpClient` as follows:

build.gradle

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ archivesBaseName = "dbip"
1111
version = '1.0'
1212

1313
jar {
14-
baseName = "Java DB-IP"
14+
baseName = "Java-DB-IP"
1515
manifest {
1616
attributes 'Implementation-Title': 'Gradle Quickstart',
1717
'Implementation-Version': version
@@ -31,13 +31,13 @@ dependencies {
3131
testCompile('org.codehaus.groovy:groovy-all:2.4.5')
3232
}
3333

34-
sourceSets {
35-
main {
36-
java { srcDirs = ["src/main/java"] } // no source dirs for the java compiler
37-
groovy { srcDirs = ["src/test/groovy"] } // compile everything in src/ with groovy
38-
}
39-
}
40-
34+
//sourceSets {
35+
// main {
36+
// java { srcDirs = ["src/main/java"] } // no source dirs for the java compiler
37+
// groovy { srcDirs = ["src/test/groovy"] } // compile everything in src/ with groovy
38+
// }
39+
// }
40+
//
4141
test {
4242
systemProperties 'property': 'value'
4343
}

gradle.properties

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +0,0 @@
1-
#signing.keyId=
2-
#signing.password=
3-
#signing.secretKeyRingFile=
4-
#
5-
#ossrhUsername=
6-
#ossrhPassword=

src/main/java/in/ankushs/dbip/api/DbIpClient.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ public DbIpClient(final File gzip){
6464
* If nothing can be resolved for an {@code ip} , then the city,state and country
6565
* for the GeoEntity will be set to 'Unknown'
6666
* Any futher initializations of the DbIpClient will not load data into memory again.
67-
* @param gzip The dbip-city-latest.csv.gz file as a File object.
68-
* @throws InvalidIPException if {@code ip} is not a valid IP address.
67+
* @param ip The ip (as String) to be resolved.
68+
* @return a GeoEntity object representing city,state and province info
6969
*/
7070
public GeoEntity lookup(final String ip){
7171
InetAddress inetAddress = null;
@@ -83,8 +83,8 @@ public GeoEntity lookup(final String ip){
8383
* Returns a loaded GeoEntity object for a given {@code inetAddress}
8484
* If nothing can be resolved for an {@code inetAddress} , then the city,state and country
8585
* for the GeoEntity will be set to 'Unknown'
86-
* @param gzip The dbip-city-latest.csv.gz file as a File object.
87-
* @throws InvalidIPException if {@code inetAddress} is not a valid IP address.
86+
* @param inetAddress The inetAddress (as InetAddress) to be resolved.
87+
* @return a GeoEntity object representing city,state and province info
8888
*/
8989
public GeoEntity lookup(final InetAddress inetAddress){
9090
PreConditions.checkNull(inetAddress, "inetAddress cannot be null");

src/main/java/in/ankushs/dbip/importer/ResourceImporter.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ public static ResourceImporter getInstance() {
4949
* Loads the file into JVM,reading line by line.
5050
* Also transforms each line into a GeoEntity object, and save the object into the
5151
* repository.
52-
* @param gzip The dbip-city-latest.csv.gz file as a File object.
53-
* @throws IOException if {@code file} does not exist or is not gzipped.
52+
* @param file The dbip-city-latest.csv.gz file as a File object.
5453
*/
5554
public void load(final File file) {
5655

0 commit comments

Comments
 (0)