Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4505282

URLDataSource should call setDoOutput(true) before returning OutputStream

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.0.2
    • 1.4.0
    • other-libs
    • 1.0.2
    • generic
    • generic
    • Not verified



      Name: bsT130419 Date: 09/20/2001


      java version "1.4.0-beta2"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta2-b77)
      Java HotSpot(TM) Client VM (build 1.4.0-beta2-b77, mixed mode)

      For javax.activation.URLDataSource

      getContentType reuses the internal URLConnection reference (of name "url_conn")
      and that's nice. Strangely getInputStream and getOutputStream don't.

      An aside:
      In addition, I would like to bring your attention to another URLDataSource
      deficiency that seems to have fallen to the wayside that is also easy to fix
      and has been reported already:
      http://developer.java.sun.com/developer/bugParade/bugs/4120784.html

      In short, the problem is that the OutputStream doesn't work for some types of
      URLs and that all that needs to be done is to add:
      url_conn.setDoOutput(true);
        before the line
      return url_conn.getOutputStream();
        (with the squiggly braces, and the url_conn re-using fix too, of course)
      (Review ID: 132310)
      ======================================================================

            bshannon Bill Shannon (Inactive)
            bstrathesunw Bill Strathearn (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: