hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
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 GMT
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.
+     * <br/> 
+     * 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.
+     * <br/> 
+     * 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(



Mime
View raw message