Class JavaScriptURLConnection

java.lang.Object
java.net.URLConnection
org.htmlunit.protocol.javascript.JavaScriptURLConnection

public class JavaScriptURLConnection extends URLConnection
A URLConnection for supporting JavaScript URLs.
  • Field Details

    • JAVASCRIPT_PREFIX

      public static final String JAVASCRIPT_PREFIX
      The JavaScript "URL" prefix.
      See Also:
    • content_

      private final String content_
      The JavaScript code.
  • Constructor Details

    • JavaScriptURLConnection

      public JavaScriptURLConnection(URL newUrl)
      Creates an instance.
      Parameters:
      newUrl - the JavaScript URL
  • 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