commit-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bugs #8991] URLConnection doesn't support explicit mime parameters


From: anonymous
Subject: [bugs #8991] URLConnection doesn't support explicit mime parameters
Date: Mon, 17 May 2004 22:52:46 -0400
User-agent: MYOB/6.66 (AN/ON)

This mail is an automated notification from the bugs tracker
 of the project: classpath.




/**************************************************************************/
[bugs #8991] Full Item Snapshot:

URL: <http://savannah.gnu.org/bugs/?func=detailitem&item_id=8991>
Project: classpath
Submitted by: 0
On: Mon 05/17/04 at 22:51

Severity:  5 - Average
Resolution:  None
Assigned to:  None
Status:  Open
Platform Version:  None


Summary:  URLConnection doesn't support explicit mime parameters

Original Submission:  Here's a quick patch for URLConnection to handle explicit 
media type parameters [1].  It currently only modifies the classname requested 
for the Class.forName, and does not support having individual content handlers 
for all of the various media types, but it lets this fetch URL.getContent() on 
my apache instance.  (almost - we needed a handler for text/html - see attached 
"html.txt")

The sun (1.4.2_04) impl has the URLConnection.getContentType()  return [2] the 
full content type (including charset parameter), so this is compatible with 
their behavior (demonstrated by using the jre, not from the source).

My environment doesn't have the classpath prerequisites (autoconf, automake, 
etc) so I haven't tested this, though I did make this patch originally for 
kaffe, tested it there, and have been running it for over a week with no 
problems.  I havent submitted to classpath before, so if there's something
missing, please let me know.

=jr

[1] http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17
[2] "Type: [text/html; charset=ISO-8859-1]" from:

   import java.net.*;

   public class testType {
    public static void main(String args[]) {
     try {
      URL url = new URL("http://localhost/";);
      URLConnection con = url.openConnection();
      con.connect();
      Object o = con.getContent();
      String type = con.getContentType();
      System.out.println("Type: [" + type + "]");
     } catch (Exception e) {
      e.printStackTrace();
     }
    }
   }







File Attachments
-------------------

-------------------------------------------------------
Date: Mon 05/17/04 at 22:51  Name: URLConnection.java.patch  Size: 956KB   By: 
None
patch for URLConnection.java
http://savannah.gnu.org/bugs/download.php?item_id=8991&amp;item_file_id=1316






For detailed info, follow this link:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=8991>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/







reply via email to

[Prev in Thread] Current Thread [Next in Thread]