cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From reinh...@apache.org
Subject svn commit: r679406 - /cocoon/trunk/subprojects/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/url/ServletURLConnection.java
Date Thu, 24 Jul 2008 13:37:53 GMT
Author: reinhard
Date: Thu Jul 24 06:37:52 2008
New Revision: 679406

URL: http://svn.apache.org/viewvc?rev=679406&view=rev
Log:
implement getErrorStream()

(together with Steven)

Modified:
    cocoon/trunk/subprojects/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/url/ServletURLConnection.java

Modified: cocoon/trunk/subprojects/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/url/ServletURLConnection.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/subprojects/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/url/ServletURLConnection.java?rev=679406&r1=679405&r2=679406&view=diff
==============================================================================
--- cocoon/trunk/subprojects/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/url/ServletURLConnection.java
(original)
+++ cocoon/trunk/subprojects/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/url/ServletURLConnection.java
Thu Jul 24 06:37:52 2008
@@ -32,12 +32,17 @@
 import org.apache.cocoon.servletservice.Absolutizable;
 import org.apache.cocoon.servletservice.CallStackHelper;
 import org.apache.cocoon.servletservice.ServletConnection;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 public class ServletURLConnection extends HttpURLConnection {
 
     private final ServletConnection servletConnection;
+
     private final URL url;
 
+    private final Log logger = LogFactory.getLog(this.getClass());
+
     protected ServletURLConnection(URL url) throws URISyntaxException {
         super(url);
 
@@ -88,6 +93,20 @@
         }
     }
 
+    public InputStream getErrorStream() {
+        if (!this.connected) {
+            return null;
+        }
+
+        try {
+            return this.servletConnection.getInputStream();
+        } catch (Exception e) {
+            this.logger.warn(e);
+        }
+
+        return null;
+    }
+
     public InputStream getInputStream() throws IOException {
         try {
             this.connect();



Mime
View raw message