Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: deprecate obsolete utility methods #1231

Merged
merged 4 commits into from Jan 22, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -22,7 +22,9 @@
*
* @since 1.8
* @author Yaniv Inbar
* @deprecated use com.google.common.io.BaseEncoding#base64
*/
@Deprecated
public class Base64 {

/**
Expand Down
Expand Up @@ -41,6 +41,7 @@
*
* @since 1.15
* @author Eyal Peled
* @deprecated use com.google.common.annotations.Beta
*/
@Target(
value = {
Expand All @@ -52,4 +53,5 @@
ElementType.PACKAGE
})
@Documented
@Deprecated
public @interface Beta {}
Expand Up @@ -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. */
Expand Down
Expand Up @@ -22,12 +22,11 @@
/**
* Provides utility methods for working with byte arrays and I/O streams.
*
* <p>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
Expand Down
Expand Up @@ -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
Expand All @@ -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() {}
}
Expand Up @@ -19,12 +19,11 @@
/**
* Static utility methods pertaining to {@link Collection} instances.
*
* <p>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. */
Expand Down
Expand Up @@ -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);
}
Expand All @@ -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 {
Expand Down Expand Up @@ -173,6 +177,7 @@ public static <S extends Serializable> 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
Expand Down
Expand Up @@ -24,7 +24,9 @@
*
* @since 1.14
* @author Yaniv Inbar
* @deprecated use com.google.common.io.ByteSink
*/
@Deprecated
public interface StreamingContent {

/**
Expand Down