From 7ad220707fa8c342706c10484533225f2efff80e Mon Sep 17 00:00:00 2001 From: Jianghao Lu Date: Tue, 7 Jun 2016 14:23:39 -0700 Subject: [PATCH] Update dependencies to official releases --- .../java/com/microsoft/azure/AzureClient.java | 8 +-- client-runtime/build.gradle | 14 +++-- client-runtime/pom.xml | 8 --- .../com/microsoft/rest/AutoRestBaseUrl.java | 53 ------------------- .../rest/ServiceResponseBuilder.java | 6 +-- pom.xml | 22 +++----- 6 files changed, 19 insertions(+), 92 deletions(-) delete mode 100644 client-runtime/src/main/java/com/microsoft/rest/AutoRestBaseUrl.java diff --git a/azure-client-runtime/src/main/java/com/microsoft/azure/AzureClient.java b/azure-client-runtime/src/main/java/com/microsoft/azure/AzureClient.java index ce28cf8f55d1a..62a760acb4a0d 100644 --- a/azure-client-runtime/src/main/java/com/microsoft/azure/AzureClient.java +++ b/azure-client-runtime/src/main/java/com/microsoft/azure/AzureClient.java @@ -77,7 +77,7 @@ public ServiceResponse getPutOrPatchResult(Response respons int statusCode = response.code(); ResponseBody responseBody; - if (response.isSuccess()) { + if (response.isSuccessful()) { responseBody = response.body(); } else { responseBody = response.errorBody(); @@ -164,7 +164,7 @@ public AsyncPollingTask getPutOrPatchResultAsync(Response r int statusCode = response.code(); ResponseBody responseBody; - if (response.isSuccess()) { + if (response.isSuccessful()) { responseBody = response.body(); } else { responseBody = response.errorBody(); @@ -252,7 +252,7 @@ public ServiceResponse getPostOrDeleteResult(Response respo int statusCode = response.code(); ResponseBody responseBody; - if (response.isSuccess()) { + if (response.isSuccessful()) { responseBody = response.body(); } else { responseBody = response.errorBody(); @@ -337,7 +337,7 @@ public AsyncPollingTask getPostOrDeleteResultAsync(Response int statusCode = response.code(); ResponseBody responseBody; - if (response.isSuccess()) { + if (response.isSuccessful()) { responseBody = response.body(); } else { responseBody = response.errorBody(); diff --git a/client-runtime/build.gradle b/client-runtime/build.gradle index a163e9a9f89f1..73750c0d3d935 100644 --- a/client-runtime/build.gradle +++ b/client-runtime/build.gradle @@ -23,14 +23,12 @@ checkstyle { dependencies { compile 'com.google.guava:guava:18.0' - compile 'com.squareup.retrofit2:retrofit:2.0.0-beta4' - compile 'com.squareup.okhttp3:okhttp:3.2.0' - compile 'com.squareup.okio:okio:1.7.0' - compile 'com.squareup.okhttp3:logging-interceptor:3.1.1' - compile 'com.squareup.okhttp3:okhttp-urlconnection:3.1.1' - compile 'com.squareup.retrofit2:converter-jackson:2.0.0-beta4' - compile 'com.fasterxml.jackson.core:jackson-databind:2.7.1' - compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.7.1' + compile 'com.squareup.retrofit2:retrofit:2.0.2' + compile 'com.squareup.okhttp3:okhttp:3.3.1' + compile 'com.squareup.okhttp3:logging-interceptor:3.3.1' + compile 'com.squareup.okhttp3:okhttp-urlconnection:3.3.1' + compile 'com.squareup.retrofit2:converter-jackson:2.0.2' + compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.7.2' compile 'org.apache.commons:commons-lang3:3.4' testCompile 'junit:junit:4.12' testCompile 'junit:junit-dep:4.11' diff --git a/client-runtime/pom.xml b/client-runtime/pom.xml index a7c0b7441b02c..e63a421434b38 100644 --- a/client-runtime/pom.xml +++ b/client-runtime/pom.xml @@ -59,10 +59,6 @@ com.squareup.okhttp3 okhttp - - com.squareup.okio - okio - com.squareup.okhttp3 logging-interceptor @@ -75,10 +71,6 @@ com.squareup.retrofit2 converter-jackson - - com.fasterxml.jackson.core - jackson-databind - com.fasterxml.jackson.datatype jackson-datatype-joda diff --git a/client-runtime/src/main/java/com/microsoft/rest/AutoRestBaseUrl.java b/client-runtime/src/main/java/com/microsoft/rest/AutoRestBaseUrl.java deleted file mode 100644 index d89aa6852f4fd..0000000000000 --- a/client-runtime/src/main/java/com/microsoft/rest/AutoRestBaseUrl.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - */ - -package com.microsoft.rest; - -import java.util.HashMap; -import java.util.Map; - -import okhttp3.HttpUrl; -import retrofit2.BaseUrl; - -/** - * An instance of this class stores information of the host of a service. - */ -public class AutoRestBaseUrl implements BaseUrl { - /** A template based URL with variables wrapped in {}s. */ - private String template; - /** a mapping from {} wrapped variables in the template and their actual values. */ - private Map mappings; - - @Override - public HttpUrl url() { - String url = template; - for (Map.Entry entry : mappings.entrySet()) { - url = url.replace(entry.getKey(), entry.getValue()); - } - mappings.clear(); - return HttpUrl.parse(url); - } - - /** - * Creates an instance of a template based URL. - * - * @param url the template based URL to use. - */ - public AutoRestBaseUrl(String url) { - this.template = url; - this.mappings = new HashMap<>(); - } - - /** - * Sets the value for the {} wrapped variables in the template URL. - * @param matcher the {} wrapped variable to replace. - * @param value the value to set for the variable. - */ - public void set(CharSequence matcher, String value) { - this.mappings.put(matcher, value); - } -} diff --git a/client-runtime/src/main/java/com/microsoft/rest/ServiceResponseBuilder.java b/client-runtime/src/main/java/com/microsoft/rest/ServiceResponseBuilder.java index b6e057a0e6075..3ad57cb938f40 100644 --- a/client-runtime/src/main/java/com/microsoft/rest/ServiceResponseBuilder.java +++ b/client-runtime/src/main/java/com/microsoft/rest/ServiceResponseBuilder.java @@ -132,7 +132,7 @@ public ServiceResponse build(Response response) throws E, IOExc int statusCode = response.code(); ResponseBody responseBody; - if (response.isSuccess()) { + if (response.isSuccessful()) { responseBody = response.body(); } else { responseBody = response.errorBody(); @@ -140,7 +140,7 @@ public ServiceResponse build(Response response) throws E, IOExc if (responseTypes.containsKey(statusCode)) { return new ServiceResponse<>((T) buildBody(statusCode, responseBody), response); - } else if (response.isSuccess() && responseTypes.size() == 1) { + } else if (response.isSuccessful() && responseTypes.size() == 1) { return new ServiceResponse<>((T) buildBody(statusCode, responseBody), response); } else { try { @@ -175,7 +175,7 @@ public ServiceResponse buildEmpty(Response response) throws E, IOExcept int statusCode = response.code(); if (responseTypes.containsKey(statusCode)) { return new ServiceResponse<>(response); - } else if (response.isSuccess() && responseTypes.size() == 1) { + } else if (response.isSuccessful() && responseTypes.size() == 1) { return new ServiceResponse<>(response); } else { try { diff --git a/pom.xml b/pom.xml index 51a8ab8ffdcc5..aa77260c5893f 100644 --- a/pom.xml +++ b/pom.xml @@ -79,42 +79,32 @@ com.squareup.retrofit2 retrofit - 2.0.0-beta4 + 2.0.2 com.squareup.okhttp3 okhttp - 3.2.0 - - - com.squareup.okio - okio - 1.7.0 + 3.3.1 com.squareup.okhttp3 logging-interceptor - 3.1.1 + 3.3.1 com.squareup.okhttp3 okhttp-urlconnection - 3.1.1 + 3.3.1 com.squareup.retrofit2 converter-jackson - 2.0.0-beta4 - - - com.fasterxml.jackson.core - jackson-databind - 2.7.1 + 2.0.2 com.fasterxml.jackson.datatype jackson-datatype-joda - 2.7.1 + 2.7.2 org.apache.commons