From 318d74af0c65dacf2be97184bb820254aa5fd3ec Mon Sep 17 00:00:00 2001 From: Sebastian Bazley Date: Thu, 16 Dec 2010 01:47:43 +0000 Subject: [PATCH] Javadoc git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1049767 13f79535-47bb-0310-9956-ffa450edef68 --- .../http/entity/mime/content/StringBody.java | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) 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 cf15f446a..1bb69533b 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,6 +76,15 @@ public static StringBody create(final String text) throws IllegalArgumentExcepti return create(text, null, null); } + /** + * Create a StringBody from the specified text, mime type and character set. + * + * @param text to be used for the body, not {@code null} + * @param mimeType the mime type, may be {@code null} + * @param charset the character set, may be {@code null}, in which case the hosts default charset is used + * @throws UnsupportedEncodingException + * @throws IllegalArgumentException if the {@code text} parameter is null + */ public StringBody( final String text, final String mimeType, @@ -91,10 +100,28 @@ public StringBody( this.charset = charset; } + /** + * Create a StringBody from the specified text and character set. + * The mime type is set to "text/plain". + * + * @param text to be used for the body, not {@code null} + * @param charset the character set, may be {@code null}, in which case the hosts default charset is used + * @throws UnsupportedEncodingException + * @throws IllegalArgumentException if the {@code text} parameter is null + */ public StringBody(final String text, final Charset charset) throws UnsupportedEncodingException { this(text, "text/plain", charset); } + /** + * Create a StringBody from the specified text. + * The mime type is set to "text/plain". + * The hosts default charset is used. + * + * @param text to be used for the body, not {@code null} + * @throws UnsupportedEncodingException + * @throws IllegalArgumentException if the {@code text} parameter is null + */ public StringBody(final String text) throws UnsupportedEncodingException { this(text, "text/plain", null); }