From cvs-return-33470-apmail-cocoon-cvs-archive=cocoon.apache.org@cocoon.apache.org Thu Jul 24 13:38:45 2008 Return-Path: Delivered-To: apmail-cocoon-cvs-archive@www.apache.org Received: (qmail 56506 invoked from network); 24 Jul 2008 13:38:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 24 Jul 2008 13:38:45 -0000 Received: (qmail 14119 invoked by uid 500); 24 Jul 2008 13:38:44 -0000 Delivered-To: apmail-cocoon-cvs-archive@cocoon.apache.org Received: (qmail 14066 invoked by uid 500); 24 Jul 2008 13:38:44 -0000 Mailing-List: contact cvs-help@cocoon.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@cocoon.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@cocoon.apache.org Received: (qmail 14057 invoked by uid 99); 24 Jul 2008 13:38:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Jul 2008 06:38:44 -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; Thu, 24 Jul 2008 13:37:58 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 1B0732388986; Thu, 24 Jul 2008 06:37:54 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: cvs@cocoon.apache.org From: reinhard@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080724133754.1B0732388986@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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();