Fixed deprecation warnings
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1666566 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a4436e12ca
commit
e883fbb376
|
@ -37,6 +37,7 @@ import java.io.IOException;
|
|||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
class MultipartFormEntity implements HttpEntity {
|
||||
|
||||
private final AbstractMultipartForm multipart;
|
||||
|
@ -88,12 +89,7 @@ class MultipartFormEntity implements HttpEntity {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void consumeContent()
|
||||
throws IOException, UnsupportedOperationException{
|
||||
if (isStreaming()) {
|
||||
throw new UnsupportedOperationException(
|
||||
"Streaming entity does not implement #consumeContent()");
|
||||
}
|
||||
public void consumeContent() {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -78,7 +78,7 @@ public class TestMultipartEntityBuilder {
|
|||
@Test
|
||||
public void testMultipartCustomContentType() throws Exception {
|
||||
final MultipartFormEntity entity = MultipartEntityBuilder.create()
|
||||
.seContentType(ContentType.APPLICATION_XML)
|
||||
.setContentType(ContentType.APPLICATION_XML)
|
||||
.setBoundary("blah-blah")
|
||||
.setCharset(Consts.UTF_8)
|
||||
.setLaxMode()
|
||||
|
@ -92,7 +92,7 @@ public class TestMultipartEntityBuilder {
|
|||
@Test
|
||||
public void testMultipartContentTypeParameter() throws Exception {
|
||||
final MultipartFormEntity entity = MultipartEntityBuilder.create()
|
||||
.seContentType(ContentType.MULTIPART_FORM_DATA.withParameters(
|
||||
.setContentType(ContentType.MULTIPART_FORM_DATA.withParameters(
|
||||
new BasicNameValuePair("boundary", "yada-yada"),
|
||||
new BasicNameValuePair("charset", "ascii")))
|
||||
.buildEntity();
|
||||
|
@ -108,7 +108,7 @@ public class TestMultipartEntityBuilder {
|
|||
@Test
|
||||
public void testMultipartCustomContentTypeParameterOverrides() throws Exception {
|
||||
final MultipartFormEntity entity = MultipartEntityBuilder.create()
|
||||
.seContentType(ContentType.MULTIPART_FORM_DATA.withParameters(
|
||||
.setContentType(ContentType.MULTIPART_FORM_DATA.withParameters(
|
||||
new BasicNameValuePair("boundary", "yada-yada"),
|
||||
new BasicNameValuePair("charset", "ascii"),
|
||||
new BasicNameValuePair("my", "stuff")))
|
||||
|
|
Loading…
Reference in New Issue