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

Support for "data:" URL scheme

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P5 P5
    • None
    • 7
    • core-libs
    • x86
    • linux

      A DESCRIPTION OF THE REQUEST :
      "The data: URI scheme defined in IETF standard RFC 2397, is an URI scheme that allows inclusion of small data items inline, as if they were being referenced to as an external resource. They tend to be far simpler than alternative inclusion methods, such as MIME with cid: or mid:. According to the wording in the RFC, data: URIs are in fact URLs, although they do not actually locate anything." - from http://en.wikipedia.org/wiki/Data:_URL

      JUSTIFICATION :
      It would be useful for providing data to objects that only take URLs as arguments. For example, the URLClassLoader can only use URLs. But using the data: URL it would be possible for the URLClassLoader to load classes from a byte array.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      the data: URL fully supported just like the http: or jar: urls.
      ACTUAL -
      the data: URL is not supported.

      ---------- BEGIN SOURCE ----------
              URL url = new URL("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9YGARc5KB0XV+IAAAAddEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIFRoZSBHSU1Q72QlbgAAAF1JREFUGNO9zL0NglAAxPEfdLTs4BZM4DIO4C7OwQg2JoQ9LE1exdlYvBBeZ7jqch9//q1uH4TLzw4d6+ErXMMcXuHWxId3KOETnnXXV6MJpcq2MLaI97CER3N0vr4MkhoXe0rZigAAAABJRU5ErkJggg==");

      ---------- END SOURCE ----------

            chegar Chris Hegarty
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: