diff --git a/httpmime/src/main/java/org/apache/http/entity/mime/HttpMultipart.java b/httpmime/src/main/java/org/apache/http/entity/mime/HttpMultipart.java index dabeb0187..a9773df72 100644 --- a/httpmime/src/main/java/org/apache/http/entity/mime/HttpMultipart.java +++ b/httpmime/src/main/java/org/apache/http/entity/mime/HttpMultipart.java @@ -188,7 +188,7 @@ public class HttpMultipart extends Multipart { writeBytes(TWO_DASHES, out); writeBytes(boundary, out); writeBytes(CR_LF, out); - BodyPart part = (BodyPart) bodyParts.get(i); + BodyPart part = bodyParts.get(i); Field cd = part.getHeader().getField(MIME.CONTENT_DISPOSITION); diff --git a/httpmime/src/main/java/org/apache/http/entity/mime/content/AbstractContentBody.java b/httpmime/src/main/java/org/apache/http/entity/mime/content/AbstractContentBody.java index 4d36c8e61..f4ac0761f 100644 --- a/httpmime/src/main/java/org/apache/http/entity/mime/content/AbstractContentBody.java +++ b/httpmime/src/main/java/org/apache/http/entity/mime/content/AbstractContentBody.java @@ -65,10 +65,12 @@ public abstract class AbstractContentBody extends SingleBody implements ContentB } } + @Override public Entity getParent() { return this.parent; } + @Override public void setParent(final Entity parent) { this.parent = parent; } @@ -89,6 +91,7 @@ public abstract class AbstractContentBody extends SingleBody implements ContentB return Collections.emptyMap(); } + @Override public void dispose() { } diff --git a/httpmime/src/main/java/org/apache/http/entity/mime/content/FileBody.java b/httpmime/src/main/java/org/apache/http/entity/mime/content/FileBody.java index f07601963..8fa77feb5 100644 --- a/httpmime/src/main/java/org/apache/http/entity/mime/content/FileBody.java +++ b/httpmime/src/main/java/org/apache/http/entity/mime/content/FileBody.java @@ -71,6 +71,7 @@ public class FileBody extends AbstractContentBody { writeTo(out); } + @Override public void writeTo(final OutputStream out) throws IOException { if (out == null) { throw new IllegalArgumentException("Output stream may not be null"); diff --git a/httpmime/src/main/java/org/apache/http/entity/mime/content/InputStreamBody.java b/httpmime/src/main/java/org/apache/http/entity/mime/content/InputStreamBody.java index f6ca9f4ea..fb02da3e4 100644 --- a/httpmime/src/main/java/org/apache/http/entity/mime/content/InputStreamBody.java +++ b/httpmime/src/main/java/org/apache/http/entity/mime/content/InputStreamBody.java @@ -59,7 +59,7 @@ public class InputStreamBody extends AbstractContentBody { this(in, "application/octet-stream", filename); } - public InputStream getInputStream() throws IOException { + public InputStream getInputStream() { return this.in; } @@ -71,6 +71,7 @@ public class InputStreamBody extends AbstractContentBody { writeTo(out); } + @Override public void writeTo(final OutputStream out) throws IOException { if (out == null) { throw new IllegalArgumentException("Output stream may not be null"); diff --git a/httpmime/src/main/java/org/apache/http/entity/mime/content/StringBody.java b/httpmime/src/main/java/org/apache/http/entity/mime/content/StringBody.java index a74be967f..64148ef55 100644 --- a/httpmime/src/main/java/org/apache/http/entity/mime/content/StringBody.java +++ b/httpmime/src/main/java/org/apache/http/entity/mime/content/StringBody.java @@ -76,7 +76,7 @@ public class StringBody extends AbstractContentBody { this(text, "text/plain", null); } - public Reader getReader() throws IOException { + public Reader getReader() { return new InputStreamReader( new ByteArrayInputStream(this.content), this.charset); @@ -90,6 +90,7 @@ public class StringBody extends AbstractContentBody { writeTo(out); } + @Override public void writeTo(final OutputStream out) throws IOException { if (out == null) { throw new IllegalArgumentException("Output stream may not be null");