Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 75766 invoked from network); 6 Jun 2006 08:50:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 6 Jun 2006 08:50:34 -0000 Received: (qmail 39786 invoked by uid 500); 6 Jun 2006 08:50:32 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 39761 invoked by uid 500); 6 Jun 2006 08:50:32 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 39750 invoked by uid 500); 6 Jun 2006 08:50:32 -0000 Received: (qmail 39747 invoked by uid 99); 6 Jun 2006 08:50:32 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Jun 2006 01:50:31 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Jun 2006 01:50:30 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 952891A983A; Tue, 6 Jun 2006 01:50:10 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r412047 - in /jakarta/commons/proper/httpclient/trunk/src: java/org/apache/commons/httpclient/methods/ test/org/apache/commons/httpclient/ test/org/apache/commons/httpclient/auth/ Date: Tue, 06 Jun 2006 08:50:08 -0000 To: commons-cvs@jakarta.apache.org From: olegk@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20060606085010.952891A983A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: olegk Date: Tue Jun 6 01:50:08 2006 New Revision: 412047 URL: http://svn.apache.org/viewvc?rev=412047&view=rev Log: [HTTPCLIENT-536] misleading lack of javadoc in StringRequestEntity Contributed by Oleg Kalnichevski Reviewed by Roland Weber Modified: jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/methods/EntityEnclosingMethod.java jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/methods/StringRequestEntity.java jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestConnectionPersistence.java jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestEntityEnclosingMethod.java jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestNoncompliant.java jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestPostMethod.java jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestPostParameterEncoding.java jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestProxy.java jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestRedirects.java jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/auth/TestBasicAuth.java Modified: jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/methods/EntityEnclosingMethod.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/methods/EntityEnclosingMethod.java?rev=412047&r1=412046&r2=412047&view=diff ============================================================================== --- jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/methods/EntityEnclosingMethod.java (original) +++ jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/methods/EntityEnclosingMethod.java Tue Jun 6 01:50:08 2006 @@ -189,8 +189,11 @@ if (LOG.isWarnEnabled()) { LOG.warn(charset + " not supported"); } - this.requestEntity = new StringRequestEntity( - requestString); + try { + this.requestEntity = new StringRequestEntity( + requestString, null, null); + } catch (UnsupportedEncodingException ignore) { + } } } Modified: jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/methods/StringRequestEntity.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/methods/StringRequestEntity.java?rev=412047&r1=412046&r2=412047&view=diff ============================================================================== --- jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/methods/StringRequestEntity.java (original) +++ jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/methods/StringRequestEntity.java Tue Jun 6 01:50:08 2006 @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//httpclient/src/java/org/apache/commons/httpclient/methods/StringRequestEntity.java,v 1.3 2004/07/03 14:27:03 olegk Exp $ + * $HeadURL$ * $Revision$ * $Date$ * @@ -58,16 +58,11 @@ * will use the default platform charset to convert the content string * and will provide no content type.

* - *

This constructor may be deprecated or changed to use the - * default HTTP content charset (ISO-8859-1) in the release 3.1

- * - *

It is strongly recommended to use - * {@link #StringRequestEntity(String, String, String)} constructor - * instead.

- * * @see #StringRequestEntity(String, String, String) * * @param content The content to set. + * + * @deprecated use {@link #StringRequestEntity(String, String, String)} instead */ public StringRequestEntity(String content) { super(); Modified: jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestConnectionPersistence.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestConnectionPersistence.java?rev=412047&r1=412046&r2=412047&view=diff ============================================================================== --- jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestConnectionPersistence.java (original) +++ jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestConnectionPersistence.java Tue Jun 6 01:50:08 2006 @@ -78,7 +78,7 @@ this.client.setHttpConnectionManager(connman); PostMethod httppost = new PostMethod("/test/"); - httppost.setRequestEntity(new StringRequestEntity("stuff")); + httppost.setRequestEntity(new StringRequestEntity("stuff", null, null)); try { this.client.executeMethod(httppost); } finally { @@ -87,7 +87,7 @@ assertFalse(connman.getConection().isOpen()); httppost = new PostMethod("/test/"); - httppost.setRequestEntity(new StringRequestEntity("more stuff")); + httppost.setRequestEntity(new StringRequestEntity("more stuff", null, null)); try { this.client.executeMethod(httppost); } finally { @@ -105,7 +105,7 @@ this.client.setHttpConnectionManager(connman); PostMethod httppost = new PostMethod("/test/"); - httppost.setRequestEntity(new StringRequestEntity("stuff")); + httppost.setRequestEntity(new StringRequestEntity("stuff", null, null)); try { this.client.executeMethod(httppost); } finally { @@ -114,7 +114,7 @@ assertTrue(connman.getConection().isOpen()); httppost = new PostMethod("/test/"); - httppost.setRequestEntity(new StringRequestEntity("more stuff")); + httppost.setRequestEntity(new StringRequestEntity("more stuff", null, null)); try { this.client.executeMethod(httppost); } finally { @@ -132,7 +132,7 @@ this.client.setHttpConnectionManager(connman); PostMethod httppost = new PostMethod("/test/"); - httppost.setRequestEntity(new StringRequestEntity("stuff")); + httppost.setRequestEntity(new StringRequestEntity("stuff", null, null)); try { this.client.executeMethod(httppost); } finally { @@ -142,7 +142,7 @@ httppost = new PostMethod("/test/"); httppost.setRequestHeader("Connection", "close"); - httppost.setRequestEntity(new StringRequestEntity("more stuff")); + httppost.setRequestEntity(new StringRequestEntity("more stuff", null, null)); try { this.client.executeMethod(httppost); } finally { @@ -160,7 +160,7 @@ this.client.setHttpConnectionManager(connman); PostMethod httppost = new PostMethod("/test/"); - httppost.setRequestEntity(new StringRequestEntity("stuff")); + httppost.setRequestEntity(new StringRequestEntity("stuff", null, null)); try { this.client.executeMethod(httppost); } finally { @@ -170,7 +170,7 @@ httppost = new PostMethod("/test/"); httppost.setRequestHeader("Connection", "keep-alive"); - httppost.setRequestEntity(new StringRequestEntity("more stuff")); + httppost.setRequestEntity(new StringRequestEntity("more stuff", null, null)); try { this.client.executeMethod(httppost); } finally { @@ -208,7 +208,7 @@ PostMethod httppost = new PostMethod("/test/"); httppost.setRequestHeader("Connection", "close"); - httppost.setRequestEntity(new StringRequestEntity("stuff")); + httppost.setRequestEntity(new StringRequestEntity("stuff", null, null)); try { this.client.executeMethod(httppost); } finally { Modified: jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestEntityEnclosingMethod.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestEntityEnclosingMethod.java?rev=412047&r1=412046&r2=412047&view=diff ============================================================================== --- jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestEntityEnclosingMethod.java (original) +++ jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestEntityEnclosingMethod.java Tue Jun 6 01:50:08 2006 @@ -323,7 +323,7 @@ method = new PostMethod("/"); method.setRequestHeader("Content-Type", "text/plain"); - method.setRequestEntity(new StringRequestEntity("")); + method.setRequestEntity(new StringRequestEntity("", null, null)); this.client.executeMethod(method); assertEquals(200,method.getStatusLine().getStatusCode()); assertNotNull(method.getRequestHeader("Content-Length")); @@ -341,7 +341,7 @@ method = new PostMethod("/"); method.setRequestHeader("Content-Type", "text/plain"); - method.setRequestEntity(new StringRequestEntity("")); + method.setRequestEntity(new StringRequestEntity("", null, null)); method.setContentChunked(true); this.client.executeMethod(method); assertNull(method.getRequestHeader("Content-Length")); Modified: jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestNoncompliant.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestNoncompliant.java?rev=412047&r1=412046&r2=412047&view=diff ============================================================================== --- jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestNoncompliant.java (original) +++ jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestNoncompliant.java Tue Jun 6 01:50:08 2006 @@ -77,7 +77,7 @@ method.getParams().setBooleanParameter( HttpMethodParams.USE_EXPECT_CONTINUE, true); method.setRequestEntity(new StringRequestEntity( - "This is data to be sent in the body of an HTTP POST.")); + "This is data to be sent in the body of an HTTP POST.", null, null)); client.executeMethod(method); assertEquals(200, method.getStatusCode()); } Modified: jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestPostMethod.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestPostMethod.java?rev=412047&r1=412046&r2=412047&view=diff ============================================================================== --- jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestPostMethod.java (original) +++ jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestPostMethod.java Tue Jun 6 01:50:08 2006 @@ -105,7 +105,7 @@ PostMethod method = new PostMethod("/"); String stringBody = "pname1=pvalue1&pname2=pvalue2"; - method.setRequestEntity(new StringRequestEntity(stringBody)); + method.setRequestEntity(new StringRequestEntity(stringBody, null, null)); this.server.setHttpService(new EchoService()); try { this.client.executeMethod(method); Modified: jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestPostParameterEncoding.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestPostParameterEncoding.java?rev=412047&r1=412046&r2=412047&view=diff ============================================================================== --- jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestPostParameterEncoding.java (original) +++ jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestPostParameterEncoding.java Tue Jun 6 01:50:08 2006 @@ -100,7 +100,7 @@ public void testPostSetRequestBody() throws Exception { PostMethod post = new PostMethod("/foo"); String body = "this+is+the+body"; - post.setRequestEntity(new StringRequestEntity(body)); + post.setRequestEntity(new StringRequestEntity(body, null, null)); assertEquals(body, getRequestAsString(post.getRequestEntity())); } Modified: jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestProxy.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestProxy.java?rev=412047&r1=412046&r2=412047&view=diff ============================================================================== --- jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestProxy.java (original) +++ jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestProxy.java Tue Jun 6 01:50:08 2006 @@ -438,7 +438,7 @@ public void testSimplePost() throws Exception { this.server.setHttpService(new FeedbackService()); PostMethod post = new PostMethod("/"); - post.setRequestEntity(new StringRequestEntity("Like tons of stuff")); + post.setRequestEntity(new StringRequestEntity("Like tons of stuff", null, null)); try { this.client.executeMethod(post); assertEquals(HttpStatus.SC_OK, post.getStatusCode()); @@ -464,7 +464,7 @@ this.server.setRequestHandler(handlerchain); PostMethod post = new PostMethod("/"); - post.setRequestEntity(new StringRequestEntity("Like tons of stuff")); + post.setRequestEntity(new StringRequestEntity("Like tons of stuff", null, null)); try { this.client.executeMethod(post); assertEquals(HttpStatus.SC_OK, post.getStatusCode()); @@ -490,7 +490,7 @@ this.server.setRequestHandler(handlerchain); PostMethod post = new PostMethod("/"); - post.setRequestEntity(new StringRequestEntity("Like tons of stuff")); + post.setRequestEntity(new StringRequestEntity("Like tons of stuff", null, null)); try { this.client.executeMethod(post); assertEquals(HttpStatus.SC_OK, post.getStatusCode()); @@ -520,7 +520,7 @@ this.server.setRequestHandler(handlerchain); PostMethod post = new PostMethod("/"); - post.setRequestEntity(new StringRequestEntity("Like tons of stuff")); + post.setRequestEntity(new StringRequestEntity("Like tons of stuff", null, null)); try { this.client.executeMethod(post); assertEquals(HttpStatus.SC_UNAUTHORIZED, post.getStatusCode()); @@ -546,7 +546,7 @@ this.server.setRequestHandler(handlerchain); PostMethod post = new PostMethod("/"); - post.setRequestEntity(new StringRequestEntity("Like tons of stuff")); + post.setRequestEntity(new StringRequestEntity("Like tons of stuff", null, null)); try { this.client.executeMethod(post); assertEquals(HttpStatus.SC_OK, post.getStatusCode()); @@ -573,7 +573,7 @@ this.server.setRequestHandler(handlerchain); PostMethod post = new PostMethod("/"); - post.setRequestEntity(new StringRequestEntity("Like tons of stuff")); + post.setRequestEntity(new StringRequestEntity("Like tons of stuff", null, null)); try { this.client.executeMethod(post); assertEquals(HttpStatus.SC_OK, post.getStatusCode()); @@ -596,7 +596,7 @@ this.proxy.requireAuthentication(creds, "test", true); PostMethod post = new PostMethod("/"); - post.setRequestEntity(new StringRequestEntity("Like tons of stuff")); + post.setRequestEntity(new StringRequestEntity("Like tons of stuff", null, null)); try { this.client.executeMethod(post); assertEquals(HttpStatus.SC_OK, post.getStatusCode()); @@ -625,7 +625,7 @@ this.proxy.requireAuthentication(creds, "test", true); PostMethod post = new PostMethod("/"); - post.setRequestEntity(new StringRequestEntity("Like tons of stuff")); + post.setRequestEntity(new StringRequestEntity("Like tons of stuff", null, null)); try { this.client.executeMethod(post); assertEquals(HttpStatus.SC_OK, post.getStatusCode()); @@ -654,7 +654,7 @@ this.proxy.requireAuthentication(creds, "test", true); PostMethod post = new PostMethod("/"); - post.setRequestEntity(new StringRequestEntity("Like tons of stuff")); + post.setRequestEntity(new StringRequestEntity("Like tons of stuff", null, null)); try { this.client.executeMethod(post); assertEquals(HttpStatus.SC_OK, post.getStatusCode()); @@ -686,7 +686,7 @@ this.proxy.requireAuthentication(creds, "test", true); PostMethod post = new PostMethod("/"); - post.setRequestEntity(new StringRequestEntity("Like tons of stuff")); + post.setRequestEntity(new StringRequestEntity("Like tons of stuff", null, null)); try { this.client.executeMethod(post); assertEquals(HttpStatus.SC_UNAUTHORIZED, post.getStatusCode()); @@ -714,7 +714,7 @@ this.proxy.requireAuthentication(creds, "test", true); PostMethod post = new PostMethod("/"); - post.setRequestEntity(new StringRequestEntity("Like tons of stuff")); + post.setRequestEntity(new StringRequestEntity("Like tons of stuff", null, null)); try { this.client.executeMethod(post); assertEquals(HttpStatus.SC_OK, post.getStatusCode()); @@ -743,7 +743,7 @@ this.proxy.requireAuthentication(creds, "test", true); PostMethod post = new PostMethod("/"); - post.setRequestEntity(new StringRequestEntity("Like tons of stuff")); + post.setRequestEntity(new StringRequestEntity("Like tons of stuff", null, null)); try { this.client.executeMethod(post); assertEquals(HttpStatus.SC_OK, post.getStatusCode()); Modified: jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestRedirects.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestRedirects.java?rev=412047&r1=412046&r2=412047&view=diff ============================================================================== --- jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestRedirects.java (original) +++ jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestRedirects.java Tue Jun 6 01:50:08 2006 @@ -361,7 +361,7 @@ int port = this.server.getLocalPort(); this.server.setHttpService(new BasicRedirectService(host, port)); PostMethod httppost = new PostMethod("/oldlocation/"); - httppost.setRequestEntity(new StringRequestEntity("stuff")); + httppost.setRequestEntity(new StringRequestEntity("stuff", null, null)); try { this.client.executeMethod(httppost); assertEquals(HttpStatus.SC_MOVED_TEMPORARILY, httppost.getStatusCode()); Modified: jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/auth/TestBasicAuth.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/auth/TestBasicAuth.java?rev=412047&r1=412046&r2=412047&view=diff ============================================================================== --- jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/auth/TestBasicAuth.java (original) +++ jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/auth/TestBasicAuth.java Tue Jun 6 01:50:08 2006 @@ -492,7 +492,7 @@ this.server.setRequestHandler(handlerchain); PostMethod post = new PostMethod("/test/"); - post.setRequestEntity(new StringRequestEntity("Test body")); + post.setRequestEntity(new StringRequestEntity("Test body", null, null)); try { this.client.executeMethod(post); assertEquals("Test body", post.getResponseBodyAsString()); @@ -531,7 +531,7 @@ this.server.setRequestHandler(handlerchain); PutMethod put = new PutMethod("/test/"); - put.setRequestEntity(new StringRequestEntity("Test body")); + put.setRequestEntity(new StringRequestEntity("Test body", null, null)); try { this.client.executeMethod(put); assertEquals("Test body", put.getResponseBodyAsString()); --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org