From e808917a45b0cc9c7e3d9d18cc072489e9644b59 Mon Sep 17 00:00:00 2001 From: Elliotte Harold Date: Wed, 13 Mar 2019 13:02:16 -0400 Subject: [PATCH] revert #545 --- clirr-ignored-differences.xml | 4 - google-http-client-android/pom.xml | 4 - .../http/apache/ApacheHttpResponse.java | 120 ------------------ .../http/apache/HttpExtensionMethod.java | 42 ------ .../api/client/http/apache/package-info.java | 23 ---- .../client/http/apache/ApacheHttpRequest.java | 0 .../http/apache/ApacheHttpResponse.java | 0 .../http/apache/ApacheHttpTransport.java | 0 .../api/client/http/apache/ContentEntity.java | 0 .../http/apache/HttpExtensionMethod.java | 0 .../apache/SSLSocketFactoryExtension.java | 0 .../api/client/http/apache/package-info.java | 0 .../http/apache/ApacheHttpTransportTest.java | 0 pom.xml | 7 - versions.txt | 1 + 15 files changed, 1 insertion(+), 200 deletions(-) delete mode 100644 google-http-client-apache/src/main/java/com/google/api/client/http/apache/ApacheHttpResponse.java delete mode 100644 google-http-client-apache/src/main/java/com/google/api/client/http/apache/HttpExtensionMethod.java delete mode 100644 google-http-client-apache/src/main/java/com/google/api/client/http/apache/package-info.java rename {google-http-client-apache-legacy => google-http-client}/src/main/java/com/google/api/client/http/apache/ApacheHttpRequest.java (100%) rename {google-http-client-apache-legacy => google-http-client}/src/main/java/com/google/api/client/http/apache/ApacheHttpResponse.java (100%) rename {google-http-client-apache-legacy => google-http-client}/src/main/java/com/google/api/client/http/apache/ApacheHttpTransport.java (100%) rename {google-http-client-apache-legacy => google-http-client}/src/main/java/com/google/api/client/http/apache/ContentEntity.java (100%) rename {google-http-client-apache-legacy => google-http-client}/src/main/java/com/google/api/client/http/apache/HttpExtensionMethod.java (100%) rename {google-http-client-apache-legacy => google-http-client}/src/main/java/com/google/api/client/http/apache/SSLSocketFactoryExtension.java (100%) rename {google-http-client-apache-legacy => google-http-client}/src/main/java/com/google/api/client/http/apache/package-info.java (100%) rename {google-http-client-apache-legacy => google-http-client}/src/test/java/com/google/api/client/http/apache/ApacheHttpTransportTest.java (100%) diff --git a/clirr-ignored-differences.xml b/clirr-ignored-differences.xml index fb3252a38..898e94c20 100644 --- a/clirr-ignored-differences.xml +++ b/clirr-ignored-differences.xml @@ -7,8 +7,4 @@ 8001 com/google/api/client/repackaged/** - - 8001 - com/google/api/client/http/apache/** - diff --git a/google-http-client-android/pom.xml b/google-http-client-android/pom.xml index a3408c357..20974b838 100644 --- a/google-http-client-android/pom.xml +++ b/google-http-client-android/pom.xml @@ -48,9 +48,5 @@ com.google.http-client google-http-client - - com.google.http-client - google-http-client-apache - diff --git a/google-http-client-apache/src/main/java/com/google/api/client/http/apache/ApacheHttpResponse.java b/google-http-client-apache/src/main/java/com/google/api/client/http/apache/ApacheHttpResponse.java deleted file mode 100644 index 0b2e9cef5..000000000 --- a/google-http-client-apache/src/main/java/com/google/api/client/http/apache/ApacheHttpResponse.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright (c) 2010 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.http.apache; - -import com.google.api.client.http.LowLevelHttpResponse; -import java.io.IOException; -import java.io.InputStream; -import org.apache.http.Header; -import org.apache.http.HttpEntity; -import org.apache.http.HttpResponse; -import org.apache.http.StatusLine; -import org.apache.http.client.methods.HttpRequestBase; - -final class ApacheHttpResponse extends LowLevelHttpResponse { - - private final HttpRequestBase request; - private final HttpResponse response; - private final Header[] allHeaders; - - ApacheHttpResponse(HttpRequestBase request, HttpResponse response) { - this.request = request; - this.response = response; - allHeaders = response.getAllHeaders(); - } - - @Override - public int getStatusCode() { - StatusLine statusLine = response.getStatusLine(); - return statusLine == null ? 0 : statusLine.getStatusCode(); - } - - @Override - public InputStream getContent() throws IOException { - HttpEntity entity = response.getEntity(); - return entity == null ? null : entity.getContent(); - } - - @Override - public String getContentEncoding() { - HttpEntity entity = response.getEntity(); - if (entity != null) { - Header contentEncodingHeader = entity.getContentEncoding(); - if (contentEncodingHeader != null) { - return contentEncodingHeader.getValue(); - } - } - return null; - } - - @Override - public long getContentLength() { - HttpEntity entity = response.getEntity(); - return entity == null ? -1 : entity.getContentLength(); - } - - @Override - public String getContentType() { - HttpEntity entity = response.getEntity(); - if (entity != null) { - Header contentTypeHeader = entity.getContentType(); - if (contentTypeHeader != null) { - return contentTypeHeader.getValue(); - } - } - return null; - } - - @Override - public String getReasonPhrase() { - StatusLine statusLine = response.getStatusLine(); - return statusLine == null ? null : statusLine.getReasonPhrase(); - } - - @Override - public String getStatusLine() { - StatusLine statusLine = response.getStatusLine(); - return statusLine == null ? null : statusLine.toString(); - } - - public String getHeaderValue(String name) { - return response.getLastHeader(name).getValue(); - } - - @Override - public int getHeaderCount() { - return allHeaders.length; - } - - @Override - public String getHeaderName(int index) { - return allHeaders[index].getName(); - } - - @Override - public String getHeaderValue(int index) { - return allHeaders[index].getValue(); - } - - /** - * Aborts execution of the request. - * - * @since 1.4 - */ - @Override - public void disconnect() { - request.abort(); - } -} diff --git a/google-http-client-apache/src/main/java/com/google/api/client/http/apache/HttpExtensionMethod.java b/google-http-client-apache/src/main/java/com/google/api/client/http/apache/HttpExtensionMethod.java deleted file mode 100644 index 598833de5..000000000 --- a/google-http-client-apache/src/main/java/com/google/api/client/http/apache/HttpExtensionMethod.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package com.google.api.client.http.apache; - -import com.google.api.client.util.Preconditions; -import java.net.URI; -import org.apache.http.client.methods.HttpEntityEnclosingRequestBase; - -/** - * HTTP extension method. - * - * @author Yaniv Inbar - */ -final class HttpExtensionMethod extends HttpEntityEnclosingRequestBase { - - /** Request method name. */ - private final String methodName; - - /** - * @param methodName request method name - * @param uri URI - */ - public HttpExtensionMethod(String methodName, String uri) { - this.methodName = Preconditions.checkNotNull(methodName); - setURI(URI.create(uri)); - } - - @Override - public String getMethod() { - return methodName; - } -} diff --git a/google-http-client-apache/src/main/java/com/google/api/client/http/apache/package-info.java b/google-http-client-apache/src/main/java/com/google/api/client/http/apache/package-info.java deleted file mode 100644 index e0f5be089..000000000 --- a/google-http-client-apache/src/main/java/com/google/api/client/http/apache/package-info.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2010 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -/** - * HTTP Transport library for Google API's based on Apache HTTP Client version 4. - * - * @since 1.0 - * @author Yaniv Inbar - */ - -package com.google.api.client.http.apache; - diff --git a/google-http-client-apache-legacy/src/main/java/com/google/api/client/http/apache/ApacheHttpRequest.java b/google-http-client/src/main/java/com/google/api/client/http/apache/ApacheHttpRequest.java similarity index 100% rename from google-http-client-apache-legacy/src/main/java/com/google/api/client/http/apache/ApacheHttpRequest.java rename to google-http-client/src/main/java/com/google/api/client/http/apache/ApacheHttpRequest.java diff --git a/google-http-client-apache-legacy/src/main/java/com/google/api/client/http/apache/ApacheHttpResponse.java b/google-http-client/src/main/java/com/google/api/client/http/apache/ApacheHttpResponse.java similarity index 100% rename from google-http-client-apache-legacy/src/main/java/com/google/api/client/http/apache/ApacheHttpResponse.java rename to google-http-client/src/main/java/com/google/api/client/http/apache/ApacheHttpResponse.java diff --git a/google-http-client-apache-legacy/src/main/java/com/google/api/client/http/apache/ApacheHttpTransport.java b/google-http-client/src/main/java/com/google/api/client/http/apache/ApacheHttpTransport.java similarity index 100% rename from google-http-client-apache-legacy/src/main/java/com/google/api/client/http/apache/ApacheHttpTransport.java rename to google-http-client/src/main/java/com/google/api/client/http/apache/ApacheHttpTransport.java diff --git a/google-http-client-apache-legacy/src/main/java/com/google/api/client/http/apache/ContentEntity.java b/google-http-client/src/main/java/com/google/api/client/http/apache/ContentEntity.java similarity index 100% rename from google-http-client-apache-legacy/src/main/java/com/google/api/client/http/apache/ContentEntity.java rename to google-http-client/src/main/java/com/google/api/client/http/apache/ContentEntity.java diff --git a/google-http-client-apache-legacy/src/main/java/com/google/api/client/http/apache/HttpExtensionMethod.java b/google-http-client/src/main/java/com/google/api/client/http/apache/HttpExtensionMethod.java similarity index 100% rename from google-http-client-apache-legacy/src/main/java/com/google/api/client/http/apache/HttpExtensionMethod.java rename to google-http-client/src/main/java/com/google/api/client/http/apache/HttpExtensionMethod.java diff --git a/google-http-client-apache-legacy/src/main/java/com/google/api/client/http/apache/SSLSocketFactoryExtension.java b/google-http-client/src/main/java/com/google/api/client/http/apache/SSLSocketFactoryExtension.java similarity index 100% rename from google-http-client-apache-legacy/src/main/java/com/google/api/client/http/apache/SSLSocketFactoryExtension.java rename to google-http-client/src/main/java/com/google/api/client/http/apache/SSLSocketFactoryExtension.java diff --git a/google-http-client-apache-legacy/src/main/java/com/google/api/client/http/apache/package-info.java b/google-http-client/src/main/java/com/google/api/client/http/apache/package-info.java similarity index 100% rename from google-http-client-apache-legacy/src/main/java/com/google/api/client/http/apache/package-info.java rename to google-http-client/src/main/java/com/google/api/client/http/apache/package-info.java diff --git a/google-http-client-apache-legacy/src/test/java/com/google/api/client/http/apache/ApacheHttpTransportTest.java b/google-http-client/src/test/java/com/google/api/client/http/apache/ApacheHttpTransportTest.java similarity index 100% rename from google-http-client-apache-legacy/src/test/java/com/google/api/client/http/apache/ApacheHttpTransportTest.java rename to google-http-client/src/test/java/com/google/api/client/http/apache/ApacheHttpTransportTest.java diff --git a/pom.xml b/pom.xml index e18210518..586ff245d 100644 --- a/pom.xml +++ b/pom.xml @@ -57,8 +57,6 @@ google-http-client-assembly google-http-client-appengine google-http-client-android - google-http-client-apache - google-http-client-apache-legacy google-http-client-protobuf google-http-client-gson google-http-client-jackson @@ -174,11 +172,6 @@ google-http-client ${project.http-client.version} - - com.google.http-client - google-http-client-apache - ${project.http-client-apache.version} - com.google.http-client google-http-client-appengine diff --git a/versions.txt b/versions.txt index a6a7fd165..da26e05ff 100644 --- a/versions.txt +++ b/versions.txt @@ -18,3 +18,4 @@ google-http-client-jdo:1.28.0:1.28.1-SNAPSHOT google-http-client-protobuf:1.28.0:1.28.1-SNAPSHOT google-http-client-test:1.28.0:1.28.1-SNAPSHOT google-http-client-xml:1.28.0:1.28.1-SNAPSHOT +