diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/ByteArrayBody.java b/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/ByteArrayBody.java index f3a56ba11..3fdb87141 100644 --- a/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/ByteArrayBody.java +++ b/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/ByteArrayBody.java @@ -86,12 +86,6 @@ public class ByteArrayBody extends AbstractContentBody { return null; } - @Override - @Deprecated - public String getTransferEncoding() { - return MIME.ENC_BINARY; - } - @Override public long getContentLength() { return data.length; diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/ContentDescriptor.java b/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/ContentDescriptor.java index cb977ce79..720dd37ee 100644 --- a/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/ContentDescriptor.java +++ b/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/ContentDescriptor.java @@ -72,16 +72,6 @@ public interface ContentDescriptor { */ String getCharset(); - /** - * Returns the body descriptors transfer encoding. - * @return The transfer encoding. Must not be null, but "7bit", - * if no transfer-encoding was specified. - * - * @deprecated Deprecated per RFC 7578, section 4.7. Do not use - */ - @Deprecated - String getTransferEncoding(); - /** * Returns the body descriptors content-length. * @return Content length, if known, or -1, to indicate the absence of a diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/FileBody.java b/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/FileBody.java index 1b359f82d..c616f7d8d 100644 --- a/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/FileBody.java +++ b/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/FileBody.java @@ -86,11 +86,6 @@ public class FileBody extends AbstractContentBody { } } - @Override - public String getTransferEncoding() { - return MIME.ENC_BINARY; - } - @Override public long getContentLength() { return this.file.length(); diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/InputStreamBody.java b/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/InputStreamBody.java index 202c7333a..39646f26a 100644 --- a/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/InputStreamBody.java +++ b/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/InputStreamBody.java @@ -95,11 +95,6 @@ public class InputStreamBody extends AbstractContentBody { } } - @Override - public String getTransferEncoding() { - return MIME.ENC_BINARY; - } - @Override public long getContentLength() { return this.contentLength; diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/MIME.java b/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/MIME.java index 53e165435..ac6fc1cde 100644 --- a/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/MIME.java +++ b/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/MIME.java @@ -34,17 +34,9 @@ package org.apache.hc.client5.http.entity.mime; public final class MIME { public static final String CONTENT_TYPE = "Content-Type"; - /** - * @deprecated Deprecated per RFC 7578, section 4.7. Do not use - */ - @Deprecated - public static final String CONTENT_TRANSFER_ENC = "Content-Transfer-Encoding"; public static final String CONTENT_DISPOSITION = "Content-Disposition"; public static final String FIELD_PARAM_NAME = "name"; public static final String FIELD_PARAM_FILENAME = "filename"; - public static final String ENC_8BIT = "8bit"; - public static final String ENC_BINARY = "binary"; - } diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/StringBody.java b/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/StringBody.java index 0f1d88089..24329519c 100644 --- a/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/StringBody.java +++ b/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/StringBody.java @@ -79,11 +79,6 @@ public class StringBody extends AbstractContentBody { out.flush(); } - @Override - public String getTransferEncoding() { - return MIME.ENC_8BIT; - } - @Override public long getContentLength() { return this.content.length; diff --git a/httpclient5/src/test/java/org/apache/hc/client5/http/entity/mime/TestMultipartContentBody.java b/httpclient5/src/test/java/org/apache/hc/client5/http/entity/mime/TestMultipartContentBody.java index 3b426fd49..9cc00e891 100644 --- a/httpclient5/src/test/java/org/apache/hc/client5/http/entity/mime/TestMultipartContentBody.java +++ b/httpclient5/src/test/java/org/apache/hc/client5/http/entity/mime/TestMultipartContentBody.java @@ -48,8 +48,6 @@ public class TestMultipartContentBody { Assert.assertEquals("text", b1.getMediaType()); Assert.assertEquals("plain", b1.getSubType()); - Assert.assertEquals(MIME.ENC_8BIT, b1.getTransferEncoding()); - final StringBody b2 = new StringBody("more text", ContentType.create("text/other", StandardCharsets.ISO_8859_1)); Assert.assertEquals(9, b2.getContentLength()); @@ -59,18 +57,6 @@ public class TestMultipartContentBody { Assert.assertEquals("text/other", b2.getMimeType()); Assert.assertEquals("text", b2.getMediaType()); Assert.assertEquals("other", b2.getSubType()); - - Assert.assertEquals(MIME.ENC_8BIT, b2.getTransferEncoding()); - } - - @Test(expected=IllegalArgumentException.class) - public void testStringBodyInvalidConstruction1() throws Exception { - Assert.assertNotNull(new StringBody(null, ContentType.DEFAULT_TEXT)); // avoid unused warning - } - - @Test(expected=IllegalArgumentException.class) - public void testStringBodyInvalidConstruction2() throws Exception { - Assert.assertNotNull(new StringBody("stuff", null)); // avoid unused warning } @Test