Class URISchemeRequest

All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public final class URISchemeRequest extends GObject

Represents a URI scheme request.

If you register a particular URI scheme in a WebKitWebContext, using webkit_web_context_register_uri_scheme(), you have to provide a WebKitURISchemeRequestCallback. After that, when a URI request is made with that particular scheme, your callback will be called. There you will be able to access properties such as the scheme, the URI and path, and the WebKitWebView that initiated the request, and also finish the request with webkit_uri_scheme_request_finish().

  • Constructor Details

    • URISchemeRequest

      public URISchemeRequest(MemorySegment address)
      Create a URISchemeRequest instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • URISchemeRequest

      public URISchemeRequest()
      Create a new URISchemeRequest.
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the URISchemeRequest class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • asParent

      protected URISchemeRequest asParent()
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class GObject
      Returns:
      the instance as if it were its parent type
    • finish

      public void finish(InputStream stream, long streamLength, @Nullable String contentType)
      Finish a WebKitURISchemeRequest by setting the contents of the request and its mime type.
      Parameters:
      stream - a GInputStream to read the contents of the request
      streamLength - the length of the stream or -1 if not known
      contentType - the content type of the stream or null if not known
    • finishError

      public void finishError(GError error)
      Finish a WebKitURISchemeRequest with a GError.
      Parameters:
      error - a GError that will be passed to the WebKitWebView
      Since:
      2.2
    • finishWithResponse

      public void finishWithResponse(URISchemeResponse response)
      Finish a WebKitURISchemeRequest by returning a WebKitURISchemeResponse
      Parameters:
      response - a WebKitURISchemeResponse
      Since:
      2.36
    • getHttpBody

      public InputStream getHttpBody()
      Get the request body.
      Returns:
      (nullable): the body of the request.
      Since:
      2.40
    • getHttpHeaders

      public MessageHeaders getHttpHeaders()
      Get the SoupMessageHeaders of the request.
      Returns:
      the SoupMessageHeaders of the request.
      Since:
      2.36
    • getHttpMethod

      public String getHttpMethod()
      Get the HTTP method of the request.
      Returns:
      the HTTP method of the this URISchemeRequest
      Since:
      2.36
    • getPath

      public String getPath()
      Get the URI path of request.
      Returns:
      the URI path of this URISchemeRequest
    • getScheme

      public String getScheme()
      Get the URI scheme of request.
      Returns:
      the URI scheme of this URISchemeRequest
    • getUri

      public String getUri()
      Get the URI of request.
      Returns:
      the full URI of this URISchemeRequest
    • getWebView

      public WebView getWebView()
      Get the WebKitWebView that initiated the request.
      Returns:
      the WebKitWebView that initiated request.
    • builder

      public static URISchemeRequest.Builder<? extends URISchemeRequest.Builder> builder()
      A URISchemeRequest.Builder object constructs a URISchemeRequest with the specified properties. Use the various set...() methods to set properties, and finish construction with URISchemeRequest.Builder.build().
      Returns:
      the builder object