I'm checking this in.

This implements a stub I found in java.net.

Tom

2006-03-23  Tom Tromey  <[EMAIL PROTECTED]>

        * java/net/URLConnection.java (getContent(Class[])): Implemented.

Index: java/net/URLConnection.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/net/URLConnection.java,v
retrieving revision 1.38
diff -u -r1.38 URLConnection.java
--- java/net/URLConnection.java 22 Mar 2006 19:15:24 -0000      1.38
+++ java/net/URLConnection.java 23 Mar 2006 15:31:17 -0000
@@ -38,8 +38,6 @@
 
 package java.net;
 
-import gnu.classpath.NotImplementedException;
-
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
@@ -462,10 +460,15 @@
    * content type
    */
   public Object getContent(Class[] classes)
-    throws IOException, NotImplementedException
+    throws IOException
   {
-    // FIXME: implement this
-    return getContent();
+    if (! connected)
+      connect();
+    String type = getContentType();
+    ContentHandler ch = getContentHandler(type);
+    if (ch != null)
+      return ch.getContent(this, classes);
+    throw new UnknownServiceException("protocol does not support the content 
type");
   }
 
   /**

Reply via email to