Class URIResponse

All Implemented Interfaces:
Proxy

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

Represents an URI response.

A WebKitURIResponse contains information such as the URI, the status code, the content length, the mime type, the HTTP status or the suggested filename.

  • Constructor Details

    • URIResponse

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

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

    • getType

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

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

      protected URIResponse 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
    • getContentLength

      public long getContentLength()

      Get the expected content length of the WebKitURIResponse.

      It can be 0 if the server provided an incorrect or missing Content-Length.

      Returns:
      the expected content length of response.
    • getHttpHeaders

      public MessageHeaders getHttpHeaders()
      Get the HTTP headers of a WebKitURIResponse as a SoupMessageHeaders.
      Returns:
      a SoupMessageHeaders with the HTTP headers of this URIResponse or null if this URIResponse is not an HTTP response.
      Since:
      2.6
    • getMimeType

      public String getMimeType()
      Gets the MIME type of the response.
      Returns:
      MIME type, as a string.
    • getStatusCode

      public int getStatusCode()

      Get the status code of the WebKitURIResponse.

      Get the status code of the WebKitURIResponse as returned by the server. It will normally be a SoupKnownStatusCode, for example Status.OK, though the server can respond with any unsigned integer.

      Returns:
      the status code of this URIResponse
    • getSuggestedFilename

      public String getSuggestedFilename()

      Get the suggested filename for response.

      Get the suggested filename for response, as specified by the 'Content-Disposition' HTTP header, or null if it's not present.

      Returns:
      the suggested filename or null if the 'Content-Disposition' HTTP header is not present.
    • getUri

      public String getUri()
      Gets the URI which resulted in the response.
      Returns:
      response URI, as a string.
    • builder

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