[java] Removing deprecated methods from HttpMessage
package org.openqa.selenium.remote.http;
+import static com.google.common.net.HttpHeaders.CONTENT_TYPE;
+import static java.nio.charset.StandardCharsets.UTF_8;
+
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Multimap;
import org.openqa.selenium.internal.Require;
import java.io.InputStream;
-import java.io.Reader;
import java.nio.charset.Charset;
import java.util.HashMap;
import java.util.Iterator;
import java.util.function.Supplier;
import java.util.stream.Collectors;
-import static com.google.common.net.HttpHeaders.CONTENT_TYPE;
-import static java.nio.charset.StandardCharsets.UTF_8;
-import static org.openqa.selenium.remote.http.Contents.bytes;
-import static org.openqa.selenium.remote.http.Contents.reader;
-import static org.openqa.selenium.remote.http.Contents.string;
-
abstract class HttpMessage<M extends HttpMessage<M>> {
private final Multimap<String, String> headers = ArrayListMultimap.create();
@@ -127,22 +123,6 @@ public Charset getContentEncoding() {
return charset;
}
- /**
- * @deprecated Pass {@link Contents#bytes(byte[])} to {@link #setContent(Supplier)}.
- */
- @Deprecated
- public void setContent(byte[] data) {
- setContent(bytes(data));
- }
-
- /**
- * @deprecated Pass {@code () -> toStreamFrom} to {@link #setContent(Supplier)}.
- */
- @Deprecated
- public void setContent(InputStream toStreamFrom) {
- setContent(() -> toStreamFrom);
- }
-
public M setContent(Supplier<InputStream> supplier) {
this.content = Require.nonNull("Supplier", supplier);
return self();
@@ -152,40 +132,6 @@ public M setContent(Supplier<InputStream> supplier) {
return content;
}
- /**
- * @deprecated Use {@link Contents#string(HttpMessage)} instead.
- */
- @Deprecated
- public String getContentString() {
- return string(this);
- }
-
- /**
- * @deprecated Use {@link Contents#reader(HttpMessage)} instead.
- */
- @Deprecated
- public Reader getContentReader() {
- return reader(this);
- }
-
- /**
- * @deprecated Use {@link #getContent()} and call {@link Supplier#get()}.
- */
- @Deprecated
- public InputStream getContentStream() {
- return getContent().get();
- }
-
- /**
- * Get the underlying content stream, bypassing the caching mechanisms that allow it to be read
- * again.
- * @deprecated No direct replacement. Use {@link #getContent()} and call {@link Supplier#get()}.
- */
- @Deprecated
- public InputStream consumeContentStream() {
- return getContent().get();
- }
-
@SuppressWarnings("unchecked")
private M self() {
return (M) this;
