Removed deprecated code

This commit is contained in:
Oleg Kalnichevski 2017-10-01 11:42:51 +02:00
parent f959d44ec7
commit e2a464084c
7 changed files with 0 additions and 53 deletions

View File

@ -86,12 +86,6 @@ public class ByteArrayBody extends AbstractContentBody {
return null; return null;
} }
@Override
@Deprecated
public String getTransferEncoding() {
return MIME.ENC_BINARY;
}
@Override @Override
public long getContentLength() { public long getContentLength() {
return data.length; return data.length;

View File

@ -72,16 +72,6 @@ public interface ContentDescriptor {
*/ */
String getCharset(); 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. * Returns the body descriptors content-length.
* @return Content length, if known, or -1, to indicate the absence of a * @return Content length, if known, or -1, to indicate the absence of a

View File

@ -86,11 +86,6 @@ public class FileBody extends AbstractContentBody {
} }
} }
@Override
public String getTransferEncoding() {
return MIME.ENC_BINARY;
}
@Override @Override
public long getContentLength() { public long getContentLength() {
return this.file.length(); return this.file.length();

View File

@ -95,11 +95,6 @@ public class InputStreamBody extends AbstractContentBody {
} }
} }
@Override
public String getTransferEncoding() {
return MIME.ENC_BINARY;
}
@Override @Override
public long getContentLength() { public long getContentLength() {
return this.contentLength; return this.contentLength;

View File

@ -34,17 +34,9 @@ package org.apache.hc.client5.http.entity.mime;
public final class MIME { public final class MIME {
public static final String CONTENT_TYPE = "Content-Type"; 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 CONTENT_DISPOSITION = "Content-Disposition";
public static final String FIELD_PARAM_NAME = "name"; public static final String FIELD_PARAM_NAME = "name";
public static final String FIELD_PARAM_FILENAME = "filename"; public static final String FIELD_PARAM_FILENAME = "filename";
public static final String ENC_8BIT = "8bit";
public static final String ENC_BINARY = "binary";
} }

View File

@ -79,11 +79,6 @@ public class StringBody extends AbstractContentBody {
out.flush(); out.flush();
} }
@Override
public String getTransferEncoding() {
return MIME.ENC_8BIT;
}
@Override @Override
public long getContentLength() { public long getContentLength() {
return this.content.length; return this.content.length;

View File

@ -48,8 +48,6 @@ public class TestMultipartContentBody {
Assert.assertEquals("text", b1.getMediaType()); Assert.assertEquals("text", b1.getMediaType());
Assert.assertEquals("plain", b1.getSubType()); Assert.assertEquals("plain", b1.getSubType());
Assert.assertEquals(MIME.ENC_8BIT, b1.getTransferEncoding());
final StringBody b2 = new StringBody("more text", final StringBody b2 = new StringBody("more text",
ContentType.create("text/other", StandardCharsets.ISO_8859_1)); ContentType.create("text/other", StandardCharsets.ISO_8859_1));
Assert.assertEquals(9, b2.getContentLength()); Assert.assertEquals(9, b2.getContentLength());
@ -59,18 +57,6 @@ public class TestMultipartContentBody {
Assert.assertEquals("text/other", b2.getMimeType()); Assert.assertEquals("text/other", b2.getMimeType());
Assert.assertEquals("text", b2.getMediaType()); Assert.assertEquals("text", b2.getMediaType());
Assert.assertEquals("other", b2.getSubType()); 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 @Test