Skip to content

Commit 97ff43c

Browse files
committed
[java] Removing deprecated methods from HttpMessage
1 parent b0efb18 commit 97ff43c

1 file changed

Lines changed: 3 additions & 57 deletions

File tree

java/src/org/openqa/selenium/remote/http/HttpMessage.java

Lines changed: 3 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717

1818
package org.openqa.selenium.remote.http;
1919

20+
import static com.google.common.net.HttpHeaders.CONTENT_TYPE;
21+
import static java.nio.charset.StandardCharsets.UTF_8;
22+
2023
import com.google.common.collect.ArrayListMultimap;
2124
import com.google.common.collect.ImmutableSet;
2225
import com.google.common.collect.Multimap;
@@ -25,7 +28,6 @@
2528
import org.openqa.selenium.internal.Require;
2629

2730
import java.io.InputStream;
28-
import java.io.Reader;
2931
import java.nio.charset.Charset;
3032
import java.util.HashMap;
3133
import java.util.Iterator;
@@ -34,12 +36,6 @@
3436
import java.util.function.Supplier;
3537
import java.util.stream.Collectors;
3638

37-
import static com.google.common.net.HttpHeaders.CONTENT_TYPE;
38-
import static java.nio.charset.StandardCharsets.UTF_8;
39-
import static org.openqa.selenium.remote.http.Contents.bytes;
40-
import static org.openqa.selenium.remote.http.Contents.reader;
41-
import static org.openqa.selenium.remote.http.Contents.string;
42-
4339
abstract class HttpMessage<M extends HttpMessage<M>> {
4440

4541
private final Multimap<String, String> headers = ArrayListMultimap.create();
@@ -127,22 +123,6 @@ public Charset getContentEncoding() {
127123
return charset;
128124
}
129125

130-
/**
131-
* @deprecated Pass {@link Contents#bytes(byte[])} to {@link #setContent(Supplier)}.
132-
*/
133-
@Deprecated
134-
public void setContent(byte[] data) {
135-
setContent(bytes(data));
136-
}
137-
138-
/**
139-
* @deprecated Pass {@code () -> toStreamFrom} to {@link #setContent(Supplier)}.
140-
*/
141-
@Deprecated
142-
public void setContent(InputStream toStreamFrom) {
143-
setContent(() -> toStreamFrom);
144-
}
145-
146126
public M setContent(Supplier<InputStream> supplier) {
147127
this.content = Require.nonNull("Supplier", supplier);
148128
return self();
@@ -152,40 +132,6 @@ public Supplier<InputStream> getContent() {
152132
return content;
153133
}
154134

155-
/**
156-
* @deprecated Use {@link Contents#string(HttpMessage)} instead.
157-
*/
158-
@Deprecated
159-
public String getContentString() {
160-
return string(this);
161-
}
162-
163-
/**
164-
* @deprecated Use {@link Contents#reader(HttpMessage)} instead.
165-
*/
166-
@Deprecated
167-
public Reader getContentReader() {
168-
return reader(this);
169-
}
170-
171-
/**
172-
* @deprecated Use {@link #getContent()} and call {@link Supplier#get()}.
173-
*/
174-
@Deprecated
175-
public InputStream getContentStream() {
176-
return getContent().get();
177-
}
178-
179-
/**
180-
* Get the underlying content stream, bypassing the caching mechanisms that allow it to be read
181-
* again.
182-
* @deprecated No direct replacement. Use {@link #getContent()} and call {@link Supplier#get()}.
183-
*/
184-
@Deprecated
185-
public InputStream consumeContentStream() {
186-
return getContent().get();
187-
}
188-
189135
@SuppressWarnings("unchecked")
190136
private M self() {
191137
return (M) this;

0 commit comments

Comments
 (0)