Skip to content

Commit dfd4b9e

Browse files
committed
Merge branch 'dev' into issue2
2 parents 66eacec + 6b14cd0 commit dfd4b9e

3 files changed

Lines changed: 28 additions & 4 deletions

File tree

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ Piwik Java Tracker
33
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.piwik.java.tracking/piwik-java-tracker/badge.svg?style=flat)](https://maven-badges.herokuapp.com/maven-central/org.piwik.java.tracking/piwik-java-tracker)
44
[![Build Status](https://travis-ci.org/piwik/piwik-java-tracker.svg?branch=master)](https://travis-ci.org/piwik/piwik-java-tracker)
55

6-
Java implementation of the [Piwik Tracking HTTP API](http://developer.piwik.org/api-reference/tracking-api).
6+
Official Java implementation of the [Piwik Tracking HTTP API](http://developer.piwik.org/api-reference/tracking-api).
7+
8+
## Javadoc
9+
The Javadoc for this project is hosted as a Github page for this repo. The latest Javadoc can be found [here](http://piwik.github.io/piwik-java-tracker/javadoc/1.0.0/index.html).
710

811
## Using this API
912
### Create a Request
@@ -81,6 +84,21 @@ Clean this project using
8184
```shell
8285
mvn clean
8386
```
87+
88+
## Dependencies
89+
All dependencies used to compile and test this project can be found in [lib/](lib). Include these as needed in your project.
90+
91+
## Contribute
92+
Have a fantastic feature idea? Spot a bug? We would absolutely love for you to contribute to this project! Please feel free to:
93+
* Fork this project
94+
* Create a feature branch from the <strong>dev</strong> branch
95+
* Write awesome code that does awesome things
96+
* Write awesome test that test your awesome code
97+
* Verify that everything is working as it should by running <strong>ant test</strong>. If everything passes, you may want to make sure that your tests are covering everything you think they are! Run <strong>ant mutate</strong> to find out!
98+
* Commit this code to your repository
99+
* Submit a pull request from your branch to our dev branch and let us know why you made the changes you did
100+
* We'll take a look at your request and work to get it integrated with the repo!
101+
84102
## Contact
85103
brett.csorba@ge.com
86104

src/main/java/org/piwik/java/tracking/PiwikRequest.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77
package org.piwik.java.tracking;
88

9+
import java.io.UnsupportedEncodingException;
910
import java.net.URL;
1011
import java.net.URLEncoder;
1112
import java.nio.charset.Charset;
@@ -1464,7 +1465,11 @@ public String getUrlEncodedQueryString(){
14641465
}
14651466
sb.append(parameter.getKey());
14661467
sb.append("=");
1467-
sb.append(URLEncoder.encode(parameter.getValue().toString()));
1468+
try {
1469+
sb.append(URLEncoder.encode(parameter.getValue().toString(), "UTF-8"));
1470+
} catch (UnsupportedEncodingException e) {
1471+
System.err.println(e.getMessage());
1472+
}
14681473
}
14691474

14701475
return sb.toString();

src/main/java/org/piwik/java/tracking/PiwikTracker.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import org.apache.http.client.methods.HttpPost;
1818
import org.apache.http.entity.ContentType;
1919
import org.apache.http.entity.StringEntity;
20-
import org.apache.http.impl.client.DefaultHttpClient;
20+
import org.apache.http.impl.client.HttpClientBuilder;
2121

2222
/**
2323
* A class that sends {@link PiwikRequest}s to a specified Piwik server.
@@ -103,6 +103,7 @@ public HttpResponse sendBulkRequest(Iterable<PiwikRequest> requests, String auth
103103
* @return a HTTP client
104104
*/
105105
protected HttpClient getHttpClient(){
106-
return new DefaultHttpClient();
106+
HttpClient client = HttpClientBuilder.create().build();
107+
return client;
107108
}
108109
}

0 commit comments

Comments
 (0)