diff --git a/google-http-client/src/main/java/com/google/api/client/http/HttpRequest.java b/google-http-client/src/main/java/com/google/api/client/http/HttpRequest.java index 7a28ec515..312702b9a 100644 --- a/google-http-client/src/main/java/com/google/api/client/http/HttpRequest.java +++ b/google-http-client/src/main/java/com/google/api/client/http/HttpRequest.java @@ -1012,7 +1012,9 @@ public HttpResponse execute() throws IOException { LowLevelHttpResponse lowLevelHttpResponse = lowLevelHttpRequest.execute(); if (lowLevelHttpResponse != null) { OpenCensusUtils.recordReceivedMessageEvent(span, lowLevelHttpResponse.getContentLength()); - span.putAttribute(HttpTraceAttributeConstants.HTTP_STATUS_CODE, AttributeValue.longAttributeValue(lowLevelHttpResponse.getStatusCode())); + span.putAttribute( + HttpTraceAttributeConstants.HTTP_STATUS_CODE, + AttributeValue.longAttributeValue(lowLevelHttpResponse.getStatusCode())); } // Flag used to indicate if an exception is thrown before the response is constructed. boolean responseConstructed = false; diff --git a/google-http-client/src/main/java/com/google/api/client/util/Base64.java b/google-http-client/src/main/java/com/google/api/client/util/Base64.java index 038156390..9225cd5dd 100644 --- a/google-http-client/src/main/java/com/google/api/client/util/Base64.java +++ b/google-http-client/src/main/java/com/google/api/client/util/Base64.java @@ -22,7 +22,9 @@ * * @since 1.8 * @author Yaniv Inbar + * @deprecated use com.google.common.io.BaseEncoding#base64 */ +@Deprecated public class Base64 { /** diff --git a/google-http-client/src/main/java/com/google/api/client/util/Beta.java b/google-http-client/src/main/java/com/google/api/client/util/Beta.java index c5f6e3d1b..87e4f710f 100644 --- a/google-http-client/src/main/java/com/google/api/client/util/Beta.java +++ b/google-http-client/src/main/java/com/google/api/client/util/Beta.java @@ -41,6 +41,7 @@ * * @since 1.15 * @author Eyal Peled + * @deprecated use com.google.common.annotations.Beta */ @Target( value = { @@ -52,4 +53,5 @@ ElementType.PACKAGE }) @Documented +@Deprecated public @interface Beta {} diff --git a/google-http-client/src/main/java/com/google/api/client/util/ByteArrayStreamingContent.java b/google-http-client/src/main/java/com/google/api/client/util/ByteArrayStreamingContent.java index 24939307d..bb4820c4d 100644 --- a/google-http-client/src/main/java/com/google/api/client/util/ByteArrayStreamingContent.java +++ b/google-http-client/src/main/java/com/google/api/client/util/ByteArrayStreamingContent.java @@ -24,7 +24,9 @@ * * @since 1.14 * @author Yaniv Inbar + * @deprecated use com.google.common.io.ByteSource */ +@Deprecated public class ByteArrayStreamingContent implements StreamingContent { /** Byte array content. */ diff --git a/google-http-client/src/main/java/com/google/api/client/util/ByteStreams.java b/google-http-client/src/main/java/com/google/api/client/util/ByteStreams.java index 00f7702cb..6443214cf 100644 --- a/google-http-client/src/main/java/com/google/api/client/util/ByteStreams.java +++ b/google-http-client/src/main/java/com/google/api/client/util/ByteStreams.java @@ -22,12 +22,11 @@ /** * Provides utility methods for working with byte arrays and I/O streams. * - *

NOTE: this is a copy of a subset of Guava's {@link com.google.common.io.ByteStreams}. The - * implementation must match as closely as possible to Guava's implementation. - * * @since 1.14 * @author Yaniv Inbar + * @deprecated use Guava's com.google.common.io.ByteStreams */ +@Deprecated public final class ByteStreams { private static final int BUF_SIZE = 0x1000; // 4K diff --git a/google-http-client/src/main/java/com/google/api/client/util/Charsets.java b/google-http-client/src/main/java/com/google/api/client/util/Charsets.java index ecc460dec..7546cceb8 100644 --- a/google-http-client/src/main/java/com/google/api/client/util/Charsets.java +++ b/google-http-client/src/main/java/com/google/api/client/util/Charsets.java @@ -15,6 +15,7 @@ package com.google.api.client.util; import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; /** * Contains constant definitions for some standard {@link Charset} instances that are guaranteed to @@ -25,14 +26,16 @@ * * @since 1.14 * @author Yaniv Inbar + * @deprecated use java.nio.charset.StandardCharsets */ +@Deprecated public final class Charsets { /** UTF-8 charset. */ - public static final Charset UTF_8 = Charset.forName("UTF-8"); + public static final Charset UTF_8 = StandardCharsets.UTF_8; /** ISO-8859-1 charset. */ - public static final Charset ISO_8859_1 = Charset.forName("ISO-8859-1"); + public static final Charset ISO_8859_1 = StandardCharsets.ISO_8859_1; private Charsets() {} } diff --git a/google-http-client/src/main/java/com/google/api/client/util/Collections2.java b/google-http-client/src/main/java/com/google/api/client/util/Collections2.java index 5cd920446..7c609496b 100644 --- a/google-http-client/src/main/java/com/google/api/client/util/Collections2.java +++ b/google-http-client/src/main/java/com/google/api/client/util/Collections2.java @@ -19,12 +19,11 @@ /** * Static utility methods pertaining to {@link Collection} instances. * - *

NOTE: this is a copy of a subset of Guava's {@link com.google.common.collect.Collections2}. - * The implementation must match as closely as possible to Guava's implementation. - * * @since 1.14 * @author Yaniv Inbar + * @deprecated use Guava's {@link com.google.common.collect.Collections2} */ +@Deprecated public final class Collections2 { /** Used to avoid http://bugs.sun.com/view_bug.do?bug_id=6558557. */ diff --git a/google-http-client/src/main/java/com/google/api/client/util/IOUtils.java b/google-http-client/src/main/java/com/google/api/client/util/IOUtils.java index 9ccad9886..6d7ff929e 100644 --- a/google-http-client/src/main/java/com/google/api/client/util/IOUtils.java +++ b/google-http-client/src/main/java/com/google/api/client/util/IOUtils.java @@ -54,7 +54,9 @@ public class IOUtils { * * @param inputStream source input stream * @param outputStream destination output stream + * @deprecated use {@link com.google.common.io.ByteStreams#copy(InputStream, OutputStream)} */ + @Deprecated public static void copy(InputStream inputStream, OutputStream outputStream) throws IOException { copy(inputStream, outputStream, true); } @@ -79,7 +81,9 @@ public static void copy(InputStream inputStream, OutputStream outputStream) thro * @param inputStream source input stream * @param outputStream destination output stream * @param closeInputStream whether the input stream should be closed at the end of this method + * @deprecated use {@link com.google.common.io.ByteStreams#copy(InputStream, OutputStream)} */ + @Deprecated public static void copy( InputStream inputStream, OutputStream outputStream, boolean closeInputStream) throws IOException { @@ -173,6 +177,7 @@ public static S deserialize(InputStream inputStream) th * Returns whether the given file is a symbolic link. * * @since 1.16 + * @deprecated use java.nio.file.Path#isSymbolicLink */ public static boolean isSymbolicLink(File file) throws IOException { // first try using Java 7 diff --git a/google-http-client/src/main/java/com/google/api/client/util/StreamingContent.java b/google-http-client/src/main/java/com/google/api/client/util/StreamingContent.java index 8ae55bbf6..27347bafb 100644 --- a/google-http-client/src/main/java/com/google/api/client/util/StreamingContent.java +++ b/google-http-client/src/main/java/com/google/api/client/util/StreamingContent.java @@ -24,7 +24,9 @@ * * @since 1.14 * @author Yaniv Inbar + * @deprecated use com.google.common.io.ByteSink */ +@Deprecated public interface StreamingContent { /**