Skip to content

Commit 36a9d8a

Browse files
author
Doug Black
committed
merge master
2 parents 901ae94 + 7819b02 commit 36a9d8a

File tree

15 files changed

+250
-89
lines changed

15 files changed

+250
-89
lines changed

AUTHORS

Lines changed: 0 additions & 16 deletions
This file was deleted.

AUTHORS.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
Authors
2+
=======
3+
4+
A huge thanks to all of our contributors:
5+
6+
7+
- Adam Ballai
8+
- Adam Rich
9+
- Adam Richeimer
10+
- Andrew Benton
11+
- Beans0063
12+
- Brett Gerry
13+
- Brian Levine
14+
- Carlos Diaz-Padron
15+
- Christer Fahlgren
16+
- ChristerF
17+
- Christopher C. Merris
18+
- D Keith Casey Jr
19+
- Doug Black
20+
- Eric Anderle
21+
- Frank
22+
- Frank Stratton
23+
- Girish Bharadwaj
24+
- Guillaume BINET
25+
- Jancsi Farkas
26+
- Jason Li
27+
- Jon Plax
28+
- Kevin Burke
29+
- Kevin Whinnery
30+
- Kyle
31+
- Kyle Conroy
32+
- RonaldWentworth
33+
- Sam Kimbrel
34+
- Thomas Wilsher
35+
- rschiffert@twilio.com

CHANGES

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,21 @@ twilio-java Changelog
33

44
Here you can see the full list of changes between each twilio-java release.
55

6+
Version 3.3.16
7+
--------------
8+
9+
- Adds a Makefile for consistency with other helper libraries
10+
- You can delete transcriptions
11+
12+
Version 3.3.15
13+
--------------
14+
15+
Released n/a
16+
17+
- Content-type detection is now friendlier to charset declarations in header.
18+
- GET Requests now use secure HTTPS endpoint.
19+
- TwilioUtil for validation using accountSid deprecated because accountSid is not needed.
20+
621
Version 3.3.15
722
--------------
823

Makefile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# In this case the Makefile is fairly simple. Still providing it to provide
2+
# consistency with other helper libraries
3+
.PHONY: test install clean authors
4+
5+
install:
6+
mvn install
7+
8+
test:
9+
mvn test
10+
11+
clean:
12+
rm -rf target
13+
14+
authors:
15+
echo "Authors\n=======\n\nA huge thanks to all of our contributors:\n\n" > AUTHORS.md
16+
git log --raw | grep "^Author: " | cut -d ' ' -f2- | cut -d '<' -f1 | sed 's/^/- /' | sort | uniq >> AUTHORS.md

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
1-
# Installing
1+
[![Build Status](https://travis-ci.org/twilio/twilio-java.png?branch=master)](https://travis-ci.org/twilio/twilio-java)
22

3-
TwilioJava is now using Maven. At present the jars *are* available from a public [maven](http://maven.apache.org/download.html) repository.
3+
# Installing
4+
5+
TwilioJava is now using Maven. At present the jars *are* available from a public [maven](http://maven.apache.org/download.html) repository.
46

57
Use the following dependency in your project:
68

79
<dependency>
810
<groupId>com.twilio.sdk</groupId>
911
<artifactId>twilio-java-sdk</artifactId>
10-
<version>3.3.15</version>
12+
<version>3.3.16</version>
1113
<scope>compile</scope>
1214
</dependency>
1315

1416
If you want to compile it yourself, here's how:
1517

1618
$ git clone git@github.com:twilio/twilio-java
17-
$ cd twilio-java
19+
$ cd twilio-java
1820
$ mvn install # Requires maven, download from http://maven.apache.org/download.html
1921

2022
This will also build the javadoc in `twilio-java/target/apidocs`. You can open the
2123
index.html located there to view it locally.
2224

23-
The pre-built jars are available at:
25+
The pre-built jars are available at:
2426

2527
* [twilio-java-sdk-3.3.15-with-dependencies.jar](http://search.maven.org/remotecontent?filepath=com/twilio/sdk/twilio-java-sdk/3.3.15/twilio-java-sdk-3.3.15-jar-with-dependencies.jar)
2628
* [twilio-java-sdk-3.3.15.jar](http://search.maven.org/remotecontent?filepath=com/twilio/sdk/twilio-java-sdk/3.3.15/twilio-java-sdk-3.3.15.jar) -- use this if you have issues with conflicting jars in your project. You'll need to include versions of the dependencies yourself. See the pom.xml for the list of libraries.
@@ -30,7 +32,7 @@ You can view the javadocs for this project at:
3032

3133
# Examples
3234

33-
Here are some examples (also found in [TwilioRestExamples.java](https://github.com/twilio/twilio-java/blob/master/src/main/java/com/twilio/sdk/examples/RestExamples.java) )
35+
Here are some examples (also found in [TwilioRestExamples.java](https://github.com/twilio/twilio-java/blob/master/src/main/java/com/twilio/sdk/examples/RestExamples.java) )
3436

3537
```java
3638
package com.twilio.sdk.examples;

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<artifactId>twilio-java-sdk</artifactId>
55
<packaging>jar</packaging>
66
<name>twilio-java-sdk</name>
7-
<version>3.3.16-SNAPSHOT</version>
7+
<version>3.3.17-SNAPSHOT</version>
88
<description>Java helper library for Twilio services</description>
99
<url>http://www.twilio.com</url>
1010
<licenses>

src/main/java/com/twilio/sdk/TwilioRestClient.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
public class TwilioRestClient {
4747

4848
/** The Constant VERSION. */
49-
private static final String VERSION = "3.3.15";
49+
private static final String VERSION = "3.3.16";
5050

5151
/** The endpoint. */
5252
private String endpoint = "https://api.twilio.com";
@@ -97,8 +97,12 @@ public void setHttpclient(HttpClient httpclient) {
9797
this.httpclient = httpclient;
9898
}
9999

100+
public HttpClient getHttpClient() {
101+
return httpclient;
102+
}
103+
100104
/**
101-
* Explcitly construct a TwilioRestClient with the given API credentials.
105+
* Explicitly construct a TwilioRestClient with the given API credentials.
102106
*
103107
* @param accountSid
104108
* the 34 character Account identifier (starting with 'AC'). This
@@ -113,7 +117,7 @@ public TwilioRestClient(String accountSid, String authToken) {
113117
}
114118

115119
/**
116-
* Explcitly construct a TwilioRestClient with the given API credentials and
120+
* Explicitly construct a TwilioRestClient with the given API credentials and
117121
* endpoint.
118122
*
119123
* @param accountSid
@@ -526,6 +530,7 @@ private HttpUriRequest setupRequest(String path, String method,
526530
request.addHeader(new BasicHeader("User-Agent", "twilio-java/"
527531
+ VERSION));
528532
request.addHeader(new BasicHeader("Accept", "application/json"));
533+
request.addHeader(new BasicHeader("Accept-Charset", "utf-8"));
529534

530535
if (httpclient instanceof DefaultHttpClient) { // as DefaultHttpClient class has final method, I need httpClient to be a plain interface to be able to mock it
531536
((DefaultHttpClient) httpclient).getCredentialsProvider()

src/main/java/com/twilio/sdk/TwilioRestResponse.java

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -44,19 +44,19 @@ public class TwilioRestResponse {
4444

4545
/** The response text. */
4646
private String responseText;
47-
47+
4848
/** The http status. */
4949
private int httpStatus;
50-
50+
5151
/** The url. */
5252
private String url;
53-
53+
5454
/** The query string. */
5555
private String queryString;
56-
56+
5757
/** The error. */
5858
private boolean error;
59-
59+
6060
/** The content type. */
6161
private String contentType;
6262

@@ -81,7 +81,7 @@ public TwilioRestResponse(String url, String text, int status) {
8181

8282
/**
8383
* Get the raw response body as a String
84-
*
84+
*
8585
* @return the response body
8686
*/
8787
public String getResponseText() {
@@ -100,7 +100,7 @@ public void setResponseText(String responseText) {
100100
/**
101101
102102
* Get the http status code associated with this response.
103-
*
103+
*
104104
* @return the int value of the response status
105105
*/
106106
public int getHttpStatus() {
@@ -118,7 +118,7 @@ public void setHttpStatus(int httpStatus) {
118118

119119
/**
120120
* Get the url that resulted in this response
121-
*
121+
*
122122
* @return the url
123123
*/
124124
public String getUrl() {
@@ -136,7 +136,7 @@ public void setUrl(String url) {
136136

137137
/**
138138
* Get the query string that resulted in this response
139-
*
139+
*
140140
*/
141141
public String getQueryString() {
142142
return queryString;
@@ -153,7 +153,7 @@ public void setQueryString(String queryString) {
153153

154154
/**
155155
* Determine if this request resulted in any kind of error
156-
*
156+
*
157157
* @return true if an error occured
158158
*/
159159
public boolean isError() {
@@ -171,7 +171,7 @@ public void setError(boolean error) {
171171

172172
/**
173173
* Determines if the response was a client side error (HTTP 4XX status)
174-
*
174+
*
175175
* @return true if this was a client error
176176
*/
177177
public boolean isClientError() {
@@ -180,7 +180,7 @@ public boolean isClientError() {
180180

181181
/**
182182
* Determines if the response was a server side error (HTTP 5XX status)
183-
*
183+
*
184184
* @return true if this was a server error
185185
*/
186186
public boolean isServerError() {
@@ -198,26 +198,27 @@ public void setContentType(String contentType) {
198198

199199
/**
200200
* Method to determine if the response content type was a JSON type
201-
*
201+
*
202202
* @return true if this looks like a JSON response
203203
*/
204204
public boolean isJson() {
205-
return (this.contentType.equalsIgnoreCase("application/json"));
205+
return (this.contentType.toLowerCase().contains("application/json"));
206206
}
207207

208208
/**
209209
* Method to determine if the response content type was an XML type
210-
*
210+
*
211211
* @return true if this looks like an XML response
212212
*/
213213
public boolean isXml() {
214-
return (this.contentType.equalsIgnoreCase("text/xml") || this.contentType
215-
.equalsIgnoreCase("application/xml"));
214+
String lowercaseContentType = this.contentType.toLowerCase();
215+
return (lowercaseContentType.contains("text/xml") ||
216+
lowercaseContentType.contains("application/xml"));
216217
}
217218

218219
/**
219220
* Get an appropriate response parser for this response type
220-
*
221+
*
221222
* @return a response parser capable of parsing this response body.
222223
*/
223224
public ResponseParser getParser() {
@@ -235,7 +236,7 @@ public ResponseParser getParser() {
235236
* Helper method to convert the response to a canonical object map. This
236237
* method will use the appropriate parser to map the response body to a Map
237238
* of elements.
238-
*
239+
*
239240
* @return a normalized Map of objects. Repeated elements are List values,
240241
* sub-objects are Map values. All other types are String values.
241242
*/

0 commit comments

Comments
 (0)