1717
1818package 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+
2023import com .google .common .collect .ArrayListMultimap ;
2124import com .google .common .collect .ImmutableSet ;
2225import com .google .common .collect .Multimap ;
2528import org .openqa .selenium .internal .Require ;
2629
2730import java .io .InputStream ;
28- import java .io .Reader ;
2931import java .nio .charset .Charset ;
3032import java .util .HashMap ;
3133import java .util .Iterator ;
3436import java .util .function .Supplier ;
3537import 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-
4339abstract 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