Skip to content

Commit ab45901

Browse files
author
Chris Wilson
committed
Updating version to prep for release.
1 parent 0eadb1a commit ab45901

File tree

9 files changed

+32
-29
lines changed

9 files changed

+32
-29
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ The SparkPost Java Library is available in this [Maven Repository](http://maven.
2727
<dependency>
2828
<groupId>com.sparkpost</groupId>
2929
<artifactId>sparkpost-lib</artifactId>
30-
<version>0.16.2</version>
30+
<version>0.17</version>
3131
</dependency>
3232
```
3333

apps/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<parent>
44
<groupId>com.sparkpost</groupId>
55
<artifactId>sparkpost</artifactId>
6-
<version>0.16.2</version>
6+
<version>0.17</version>
77
</parent>
88
<modelVersion>4.0.0</modelVersion>
99
<artifactId>apps</artifactId>

apps/sparkpost-documentor-app/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>com.sparkpost</groupId>
66
<artifactId>apps</artifactId>
7-
<version>0.16.2</version>
7+
<version>0.17</version>
88
</parent>
99
<artifactId>sparkpost-documentor-app</artifactId>
1010
<name>Generates Markdown of Protocol</name>

apps/sparkpost-javamail-app/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>com.sparkpost</groupId>
88
<artifactId>apps</artifactId>
9-
<version>0.16.2</version>
9+
<version>0.17</version>
1010
</parent>
1111
<groupId>com.sparkpost.sample</groupId>
1212
<artifactId>sparkpost-javamail-app</artifactId>

apps/sparkpost-samples-app/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>com.sparkpost</groupId>
66
<artifactId>apps</artifactId>
7-
<version>0.16.2</version>
7+
<version>0.17</version>
88
</parent>
99
<artifactId>sparkpost-samples-app</artifactId>
1010
<name>Example use SparkPost library</name>

libs/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>com.sparkpost</groupId>
66
<artifactId>sparkpost</artifactId>
7-
<version>0.16.2</version>
7+
<version>0.17</version>
88
</parent>
99
<modelVersion>4.0.0</modelVersion>
1010
<artifactId>libs</artifactId>

libs/sparkpost-lib/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>com.sparkpost</groupId>
66
<artifactId>libs</artifactId>
7-
<version>0.16.2</version>
7+
<version>0.17</version>
88
</parent>
99
<!-- <version>0.10</version> -->
1010
<artifactId>sparkpost-lib</artifactId>

libs/sparkpost-lib/src/main/java/com/sparkpost/transport/RestConnection.java

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public class RestConnection implements IRestConnection {
4242

4343
private final Client client;
4444

45-
private final String endpoint;
45+
private final String baseUrl;
4646

4747
/**
4848
* Supported HTTP methods
@@ -73,22 +73,22 @@ public RestConnection(Client client) throws SparkPostException {
7373
*
7474
* @param client
7575
* Client object to use (in particular for authentication info)
76-
* @param endpoint
76+
* @param baseUrl
7777
* Endpoint to use instead of the default defaultApiEndpoint
7878
* @throws SparkPostException
7979
*/
80-
public RestConnection(Client client, String endpoint) throws SparkPostException {
80+
public RestConnection(Client client, String baseUrl) throws SparkPostException {
8181

8282
this.client = client;
83-
if (StringUtils.isAnyEmpty(endpoint)) {
84-
this.endpoint = defaultApiEndpoint;
83+
if (StringUtils.isAnyEmpty(baseUrl)) {
84+
this.baseUrl = defaultApiEndpoint;
8585
} else {
8686

87-
this.endpoint = endpoint;
87+
this.baseUrl = baseUrl;
8888
}
8989

90-
if (endpoint.endsWith("/")) {
91-
throw new IllegalStateException("SPARKPOST_BASE_URL should not end with a '/', SPARKPOST_BASE_URL=" + endpoint + "");
90+
if (baseUrl.endsWith("/")) {
91+
throw new IllegalStateException("SPARKPOST_BASE_URL should not end with a '/', SPARKPOST_BASE_URL=" + baseUrl + "");
9292
}
9393
}
9494

@@ -106,8 +106,8 @@ private HttpURLConnection createConnectionObject(String path, Method method) thr
106106
HttpURLConnection conn;
107107
try {
108108
URL url;
109-
url = new URL(this.endpoint + path);
110-
109+
url = new URL(this.baseUrl + path);
110+
111111
// Retrieve the URLConnection object (but doesn't actually connect):
112112
// (HttpUrlConnection doesn't connect to the server until we've
113113
// got one of its streams)
@@ -311,7 +311,7 @@ private Response receiveSuccessResponse(HttpURLConnection conn, Response respons
311311
return response;
312312
}
313313

314-
// This is used to handle 2xx HTTP responses
314+
// This is used to handle non 2xx HTTP responses
315315
private Response receiveErrorResponse(HttpURLConnection conn, Response response) throws SparkPostException, IOException {
316316
response.setRequestId(conn.getHeaderField("X-SparkPost-Request-Id"));
317317

@@ -330,7 +330,6 @@ private Response receiveErrorResponse(HttpURLConnection conn, Response response)
330330
ServerErrorResponses errorResponses = null;
331331

332332
try {
333-
// We are in the success case handling but check the error stream anyway just in case
334333
try (BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getErrorStream(), DEFAULT_CHARSET))) {
335334

336335
String line = "";
@@ -345,8 +344,8 @@ private Response receiveErrorResponse(HttpURLConnection conn, Response response)
345344
try {
346345
errorResponses = (ServerErrorResponses) ServerErrorResponses.decode(response, ServerErrorResponses.class);
347346
} catch (Exception e) {
348-
// Maybe there is something wrong where HTML is returned or some other very bad error. So we protect
349-
// ourselves from that exception so we can throw a more specific exception later.
347+
// Maybe there is something wrong where HTML is returned or some other very bad error. Protect
348+
// against exception here so a more specific exception can be thrown later later.
350349
logger.error("Failed to parse server response:\n", e);
351350
}
352351

@@ -355,7 +354,7 @@ private Response receiveErrorResponse(HttpURLConnection conn, Response response)
355354
}
356355
} catch (Exception e) {
357356
// Log but ignore since an exception is getting thrown anyway
358-
logger.error("Error while handlign an HTTP response error. Ignoring and will use orginal exception", e);
357+
logger.error("Error while handling an HTTP response error. Ignoring and will use orginal exception", e);
359358
}
360359

361360
if (logger.isDebugEnabled()) {
@@ -392,7 +391,7 @@ private Response receiveErrorResponse(HttpURLConnection conn, Response response)
392391
}
393392
}
394393

395-
// This method actually performs an HTTP request.
394+
// This method actually performs the HTTP request
396395
// It is called by get(), put(), post() and delete() below
397396
private Response doHttpMethod(String path, Method method, String data, Response response) throws SparkPostException {
398397
HttpURLConnection conn = null;
@@ -414,7 +413,8 @@ private Response doHttpMethod(String path, Method method, String data, Response
414413
}
415414
}
416415

417-
/* (non-Javadoc)
416+
/*
417+
* (non-Javadoc)
418418
* @see com.sparkpost.transport.IRestConnection#get(java.lang.String)
419419
*/
420420
@Override
@@ -423,7 +423,8 @@ public Response get(String path) throws SparkPostException {
423423
return doHttpMethod(path, Method.GET, null, response);
424424
}
425425

426-
/* (non-Javadoc)
426+
/*
427+
* (non-Javadoc)
427428
* @see com.sparkpost.transport.IRestConnection#post(java.lang.String, java.lang.String)
428429
*/
429430
@Override
@@ -432,7 +433,8 @@ public Response post(String path, String json) throws SparkPostException {
432433
return doHttpMethod(path, Method.POST, json, response);
433434
}
434435

435-
/* (non-Javadoc)
436+
/*
437+
* (non-Javadoc)
436438
* @see com.sparkpost.transport.IRestConnection#put(java.lang.String, java.lang.String)
437439
*/
438440
@Override
@@ -441,7 +443,8 @@ public Response put(String path, String json) throws SparkPostException {
441443
return doHttpMethod(path, Method.PUT, json, response);
442444
}
443445

444-
/* (non-Javadoc)
446+
/*
447+
* (non-Javadoc)
445448
* @see com.sparkpost.transport.IRestConnection#delete(java.lang.String)
446449
*/
447450
@Override

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<modelVersion>4.0.0</modelVersion>
55
<groupId>com.sparkpost</groupId>
66
<artifactId>sparkpost</artifactId>
7-
<version>0.16.2</version>
7+
<version>0.17</version>
88
<packaging>pom</packaging>
99
<name>*** SparkPost Java Code ***</name>
1010
<description>SparkPost client library for Java https://www.sparkpost.com/</description>
@@ -258,7 +258,7 @@
258258
<dependency>
259259
<groupId>com.sparkpost</groupId>
260260
<artifactId>sparkpost-lib</artifactId>
261-
<version>0.16.2</version>
261+
<version>0.17</version>
262262
</dependency>
263263

264264
</dependencies>

0 commit comments

Comments
 (0)