From 096a8d35c936d529d84f277247e8789fe2f2c7ef Mon Sep 17 00:00:00 2001 From: Elliotte Rusty Harold Date: Wed, 13 Jan 2021 19:38:03 -0500 Subject: [PATCH 1/2] remove deprecated class --- .../apache/GoogleApacheHttpTransport.java | 85 ------------------- .../googleapis/apache/package-info.java | 21 ----- 2 files changed, 106 deletions(-) delete mode 100644 google-api-client/src/main/java/com/google/api/client/googleapis/apache/GoogleApacheHttpTransport.java delete mode 100644 google-api-client/src/main/java/com/google/api/client/googleapis/apache/package-info.java diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/apache/GoogleApacheHttpTransport.java b/google-api-client/src/main/java/com/google/api/client/googleapis/apache/GoogleApacheHttpTransport.java deleted file mode 100644 index de2d95099..000000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/apache/GoogleApacheHttpTransport.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright 2013 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.googleapis.apache; - -import com.google.api.client.googleapis.GoogleUtils; -import com.google.api.client.http.apache.ApacheHttpTransport; -import com.google.api.client.util.SslUtils; -import java.io.IOException; -import java.net.ProxySelector; -import java.security.GeneralSecurityException; -import java.security.KeyStore; -import java.util.concurrent.TimeUnit; -import javax.net.ssl.SSLContext; -import org.apache.http.client.HttpClient; -import org.apache.http.config.SocketConfig; -import org.apache.http.conn.socket.LayeredConnectionSocketFactory; -import org.apache.http.conn.ssl.SSLConnectionSocketFactory; -import org.apache.http.impl.client.HttpClientBuilder; -import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; -import org.apache.http.impl.conn.SystemDefaultRoutePlanner; - -/** - * Utilities for Google APIs based on {@link ApacheHttpTransport}. - * - * @since 1.14 - * @author Yaniv Inbar - * @deprecated Use com.google.api.client.googleapis.apache.v2.GoogleApacheHttpTransport - */ -@Deprecated -public final class GoogleApacheHttpTransport { - - /** - * Returns a new instance of {@link ApacheHttpTransport} that uses {@link - * GoogleUtils#getCertificateTrustStore()} for the trusted certificates. - * - * @deprecated Use - * com.google.api.client.googleapis.apache.v2.GoogleApacheHttpTransport.newTrustedTransport() - */ - public static ApacheHttpTransport newTrustedTransport() - throws GeneralSecurityException, IOException { - // Set socket buffer sizes to 8192 - SocketConfig socketConfig = - SocketConfig.custom().setRcvBufSize(8192).setSndBufSize(8192).build(); - - PoolingHttpClientConnectionManager connectionManager = - new PoolingHttpClientConnectionManager(-1, TimeUnit.MILLISECONDS); - - // Disable the stale connection check (previously configured in the HttpConnectionParams - connectionManager.setValidateAfterInactivity(-1); - - // Use the included trust store - KeyStore trustStore = GoogleUtils.getCertificateTrustStore(); - SSLContext sslContext = SslUtils.getTlsSslContext(); - SslUtils.initSslContext(sslContext, trustStore, SslUtils.getPkixTrustManagerFactory()); - LayeredConnectionSocketFactory socketFactory = new SSLConnectionSocketFactory(sslContext); - - HttpClient client = - HttpClientBuilder.create() - .useSystemProperties() - .setSSLSocketFactory(socketFactory) - .setDefaultSocketConfig(socketConfig) - .setMaxConnTotal(200) - .setMaxConnPerRoute(20) - .setRoutePlanner(new SystemDefaultRoutePlanner(ProxySelector.getDefault())) - .setConnectionManager(connectionManager) - .disableRedirectHandling() - .disableAutomaticRetries() - .build(); - return new ApacheHttpTransport(client); - } - - private GoogleApacheHttpTransport() {} -} diff --git a/google-api-client/src/main/java/com/google/api/client/googleapis/apache/package-info.java b/google-api-client/src/main/java/com/google/api/client/googleapis/apache/package-info.java deleted file mode 100644 index 201e2c0f2..000000000 --- a/google-api-client/src/main/java/com/google/api/client/googleapis/apache/package-info.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2013 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. - */ - -/** - * Google APIs support based on the Apache HTTP Client. - * - * @since 1.14 - * @author Yaniv Inbar - */ -package com.google.api.client.googleapis.apache; From 53e98ab18a1ec3ab8c3c3eddc34caba3384f20c5 Mon Sep 17 00:00:00 2001 From: Elliotte Rusty Harold Date: Wed, 13 Jan 2021 19:53:07 -0500 Subject: [PATCH 2/2] ignore deletion of deprecated class --- clirr-ignored-differences.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/clirr-ignored-differences.xml b/clirr-ignored-differences.xml index a4a93043c..50e8bd0ac 100644 --- a/clirr-ignored-differences.xml +++ b/clirr-ignored-differences.xml @@ -6,4 +6,8 @@ 8001 com/google/api/client/googleapis/auth/clientlogin/** + + 8001 + com/google/api/client/googleapis/apache/GoogleApacheHttpTransport +