Class DataURLConnection

java.lang.Object
java.net.URLConnection
org.htmlunit.protocol.data.DataURLConnection

public class DataURLConnection extends URLConnection
A URLConnection for supporting data URLs.
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • connect

      public void connect()
      This method does nothing in this implementation but is required to be implemented.
      Specified by:
      connect in class URLConnection
    • getInputStream

      public InputStream getInputStream()
      Returns the input stream - in this case the content of the URL.
      Overrides:
      getInputStream in class URLConnection
      Returns:
      the input stream
    • getCharset

      public String getCharset()
      Gets the charset information specified in the data URL.
      Returns:
      "US-ASCII" if the URL didn't contain any charset information
    • getMediaType

      public String getMediaType()
      Gets the media type information contained in the data URL.
      Returns:
      "text/plain" if the URL didn't contain any media type information