Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
ludovicroland committed Feb 9, 2018
2 parents a6cae7d + aebc7ef commit c413d22
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
9 changes: 3 additions & 6 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ apply plugin: "maven-publish"

ext
{
appCompatVersion="27.0.1"
appCompatVersion="27.0.2"
}

android
Expand All @@ -17,8 +17,8 @@ android
minSdkVersion 14
targetSdkVersion 27

versionCode 21
versionName "2.6.1"
versionCode 22
versionName "2.7.0"
}

buildTypes
Expand Down Expand Up @@ -128,9 +128,6 @@ publishing.publications.all

bintray
{
user = bintrayUsername
key = bintrayKey

publications = ["ReleasePublication"]

pkg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ protected int getConnectTimeout()
* @param callType the type of the HTTP method
* @param postParameters the body (as form-data fields) of the HTTP method when its a {@link CallType#Post} or a {@link CallType#Put} ; {@code null}
* otherwise
* @param headers the original headers of the request. They can be edited in order to manage some scenarios with tokens
* @param body the body (as form-data fields) of the HTTP method when its a {@link CallType#Post} or a {@link CallType#Put} ; {@code null}
* otherwise
* @param httpURLConnection the HttpURLConnection object
Expand All @@ -206,7 +207,8 @@ protected int getConnectTimeout()
* @return {@code true} if you want the request to be re-run if it has failed
* @throws CallException if you want the call to be considered as not OK
*/
protected boolean onStatusCodeNotOk(String uri, CallType callType, Map<String, String> postParameters, String body,
protected boolean onStatusCodeNotOk(String uri, CallType callType, Map<String, String> postParameters,
Map<String, String> headers, String body,
HttpURLConnection httpURLConnection, URL url, int statusCode, String statusMessage, int attemptsCount)
throws CallException
{
Expand Down Expand Up @@ -472,7 +474,8 @@ protected HttpURLConnection performHttpRequest(String uri, CallType callType, Ma
return performHttpRequest(uri, callType, headers, parameters, body, files, 0);
}

protected boolean shouldTryToConsumeErrorInputstream(int statusCode, String uri, CallType callType, Map<String, String> headers,
protected boolean shouldTryToConsumeErrorInputstream(int statusCode, String uri, CallType callType,
Map<String, String> headers,
Map<String, String> parameters, String body, List<MultipartFile> files)
{
return false;
Expand Down Expand Up @@ -733,7 +736,7 @@ else if (paramaters != null && paramaters.size() > 0)

if (!(responseCode >= HttpURLConnection.HTTP_OK && responseCode < HttpURLConnection.HTTP_MULT_CHOICE))
{
if (onStatusCodeNotOk(uri, callType, paramaters, body, httpURLConnection, url, responseCode, responseMessage,
if (onStatusCodeNotOk(uri, callType, paramaters, headers, body, httpURLConnection, url, responseCode, responseMessage,
attemptsCount + 1) == true)
{
return performHttpRequest(uri, callType, headers, paramaters, body, files, attemptsCount + 1);
Expand Down
7 changes: 3 additions & 4 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@ apply plugin: 'com.android.application'

android
{
compileSdkVersion 26
buildToolsVersion "26.0.2"
compileSdkVersion 27

defaultConfig
{
applicationId "com.smartnsoft.sample"

minSdkVersion 16
targetSdkVersion 26
targetSdkVersion 27

versionCode 1
versionName "1.0"
Expand All @@ -29,6 +28,6 @@ android

dependencies
{
implementation ("com.android.support:appcompat-v7:27.0.1")
implementation ("com.android.support:appcompat-v7:27.0.2")
implementation (project(":library"))
}

0 comments on commit c413d22

Please sign in to comment.