Return-Path: Delivered-To: apmail-hc-commits-archive@www.apache.org Received: (qmail 95483 invoked from network); 20 Oct 2008 16:46:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Oct 2008 16:46:24 -0000 Received: (qmail 77145 invoked by uid 500); 20 Oct 2008 16:46:26 -0000 Delivered-To: apmail-hc-commits-archive@hc.apache.org Received: (qmail 77113 invoked by uid 500); 20 Oct 2008 16:46:26 -0000 Mailing-List: contact commits-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list commits@hc.apache.org Received: (qmail 77104 invoked by uid 99); 20 Oct 2008 16:46:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Oct 2008 09:46:26 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Oct 2008 16:45:25 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 1F65823888EB; Mon, 20 Oct 2008 09:46:03 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r706334 - in /httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/entity: ConsumingNHttpEntityTemplate.java NHttpEntityWrapper.java Date: Mon, 20 Oct 2008 16:46:02 -0000 To: commits@hc.apache.org From: olegk@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20081020164603.1F65823888EB@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: olegk Date: Mon Oct 20 09:46:02 2008 New Revision: 706334 URL: http://svn.apache.org/viewvc?rev=706334&view=rev Log: Code cleanup in NHttpEntityWrapper and ConsumingNHttpEntityTemplate classes Modified: httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/entity/ConsumingNHttpEntityTemplate.java httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/entity/NHttpEntityWrapper.java Modified: httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/entity/ConsumingNHttpEntityTemplate.java URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/entity/ConsumingNHttpEntityTemplate.java?rev=706334&r1=706333&r2=706334&view=diff ============================================================================== --- httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/entity/ConsumingNHttpEntityTemplate.java (original) +++ httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/entity/ConsumingNHttpEntityTemplate.java Mon Oct 20 09:46:02 2008 @@ -49,7 +49,9 @@ private final ContentListener contentListener; - public ConsumingNHttpEntityTemplate(final HttpEntity httpEntity, final ContentListener contentListener) { + public ConsumingNHttpEntityTemplate( + final HttpEntity httpEntity, + final ContentListener contentListener) { super(httpEntity); this.contentListener = contentListener; } @@ -59,7 +61,7 @@ } @Override - public InputStream getContent() throws IOException, IllegalStateException { + public InputStream getContent() throws IOException, UnsupportedOperationException { throw new UnsupportedOperationException("Does not support blocking methods"); } @@ -69,13 +71,19 @@ } @Override - public void writeTo(OutputStream out) throws IOException { + public void writeTo(OutputStream out) throws IOException, UnsupportedOperationException { throw new UnsupportedOperationException("Does not support blocking methods"); } + /** + * This method is equivalent to the {@link #finish()} method. + *
+ * TODO: The name of this method is misnomer. It will be renamed to + * #finish() in the next major release. + */ @Override - public void consumeContent() throws IOException, UnsupportedOperationException { - throw new UnsupportedOperationException("Does not support blocking methods"); + public void consumeContent() throws IOException { + finish(); } public void consumeContent( Modified: httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/entity/NHttpEntityWrapper.java URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/entity/NHttpEntityWrapper.java?rev=706334&r1=706333&r2=706334&view=diff ============================================================================== --- httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/entity/NHttpEntityWrapper.java (original) +++ httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/entity/NHttpEntityWrapper.java Mon Oct 20 09:46:02 2008 @@ -56,7 +56,7 @@ } @Override - public InputStream getContent() throws IOException, IllegalStateException { + public InputStream getContent() throws IOException, UnsupportedOperationException { throw new UnsupportedOperationException("Does not support blocking methods"); } @@ -66,13 +66,19 @@ } @Override - public void writeTo(OutputStream out) throws IOException { + public void writeTo(OutputStream out) throws IOException, UnsupportedOperationException { throw new UnsupportedOperationException("Does not support blocking methods"); } + /** + * This method is equivalent to the {@link #finish()} method. + *
+ * TODO: The name of this method is misnomer. It will be renamed to + * #finish() in the next major release. + */ @Override - public void consumeContent() throws IOException, UnsupportedOperationException { - throw new UnsupportedOperationException("Does not support blocking methods"); + public void consumeContent() throws IOException { + finish(); } public void produceContent(