cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From reinh...@apache.org
Subject svn commit: r678993 - /cocoon/trunk/subprojects/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/url/ServletURLConnection.java
Date Wed, 23 Jul 2008 05:19:42 GMT
Author: reinhard
Date: Tue Jul 22 22:19:41 2008
New Revision: 678993

URL: http://svn.apache.org/viewvc?rev=678993&view=rev
Log:
. ServletURLConnection extends the abstract class java.net.HttpURLConnection
. implement getResponseCode()

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=678993&r1=678992&r2=678993&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
Tue Jul 22 22:19:41 2008
@@ -21,10 +21,10 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.net.HttpURLConnection;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.net.URL;
-import java.net.URLConnection;
 
 import javax.servlet.ServletException;
 
@@ -33,7 +33,7 @@
 import org.apache.cocoon.servletservice.CallStackHelper;
 import org.apache.cocoon.servletservice.ServletConnection;
 
-public class ServletURLConnection extends URLConnection {
+public class ServletURLConnection extends HttpURLConnection {
 
     private final ServletConnection servletConnection;
     private final URL url;
@@ -91,6 +91,7 @@
     public InputStream getInputStream() throws IOException {
         try {
             this.connect();
+
             return this.servletConnection.getInputStream();
         } catch (ServletException e) {
             IOException ioException = new IOException("Can't read from servlet URL " + this.url
+ ".");
@@ -105,10 +106,29 @@
         } catch (IOException e) {
             return 0;
         }
+
         return this.servletConnection.getLastModified();
     }
 
     public OutputStream getOutputStream() throws IOException {
         return this.servletConnection.getOutputStream();
     }
+
+    public int getResponseCode() {
+        try {
+            this.connect();
+
+            return this.servletConnection.getResponseCode();
+        } catch (IOException e) {
+            return 500;
+        }
+    }
+
+    public void disconnect() {
+        throw new UnsupportedOperationException("Not implemented yet");
+    }
+
+    public boolean usingProxy() {
+        throw new UnsupportedOperationException("Not implemented yet");
+    }
 }
\ No newline at end of file



Mime
View raw message