Class WebsiteDataManager

All Implemented Interfaces:
Proxy

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

Manages data stored locally by web sites.

You can use WebKitWebsiteDataManager to configure the local directories where website data will be stored. Use WebKitWebsiteDataManager:base-data-directory and WebKitWebsiteDataManager:base-cache-directory set a common base directory for all website data and caches.

A WebKitWebsiteDataManager can be ephemeral, in which case all the directory configuration is not needed because website data will never persist. You can create an ephemeral WebKitWebsiteDataManager with webkit_website_data_manager_new_ephemeral().

WebKitWebsiteDataManager can also be used to fetch website data, remove data stored by particular websites, or clear data for all websites modified since a given period of time.

Since:
2.10
  • Constructor Details

    • WebsiteDataManager

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

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

    • getType

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

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

      protected WebsiteDataManager 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
    • clear

      public void clear(Set<WebsiteDataTypes> types, TimeSpan timespan, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback)

      Asynchronously clear the website data of the given types modified in the past timespan.

      If timespan is 0, all website data will be removed.

      When the operation is finished, callback will be called. You can then call webkit_website_data_manager_clear_finish() to get the result of the operation.

      Due to implementation limitations, this function does not currently delete any stored cookies if timespan is nonzero. This behavior may change in the future.

      Parameters:
      types - WebKitWebsiteDataTypes
      timespan - a GTimeSpan
      cancellable - a GCancellable or null to ignore
      callback - a GAsyncReadyCallback to call when the request is satisfied
      Since:
      2.16
    • clear

      public void clear(WebsiteDataTypes types, TimeSpan timespan, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback)

      Asynchronously clear the website data of the given types modified in the past timespan.

      If timespan is 0, all website data will be removed.

      When the operation is finished, callback will be called. You can then call webkit_website_data_manager_clear_finish() to get the result of the operation.

      Due to implementation limitations, this function does not currently delete any stored cookies if timespan is nonzero. This behavior may change in the future.

      Parameters:
      types - WebKitWebsiteDataTypes
      timespan - a GTimeSpan
      cancellable - a GCancellable or null to ignore
      callback - a GAsyncReadyCallback to call when the request is satisfied
      Since:
      2.16
    • clearFinish

      public boolean clearFinish(AsyncResult result) throws GErrorException
      Finish an asynchronous operation started with webkit_website_data_manager_clear()
      Parameters:
      result - a GAsyncResult
      Returns:
      true if website data was successfully cleared, or false otherwise.
      Throws:
      GErrorException - see GError
      Since:
      2.16
    • fetch

      public void fetch(Set<WebsiteDataTypes> types, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback)

      Asynchronously get the list of WebKitWebsiteData for the given types.

      When the operation is finished, callback will be called. You can then call webkit_website_data_manager_fetch_finish() to get the result of the operation.

      Parameters:
      types - WebKitWebsiteDataTypes
      cancellable - a GCancellable or null to ignore
      callback - a GAsyncReadyCallback to call when the request is satisfied
      Since:
      2.16
    • fetch

      public void fetch(WebsiteDataTypes types, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback)

      Asynchronously get the list of WebKitWebsiteData for the given types.

      When the operation is finished, callback will be called. You can then call webkit_website_data_manager_fetch_finish() to get the result of the operation.

      Parameters:
      types - WebKitWebsiteDataTypes
      cancellable - a GCancellable or null to ignore
      callback - a GAsyncReadyCallback to call when the request is satisfied
      Since:
      2.16
    • fetchFinish

      public List<WebsiteData> fetchFinish(AsyncResult result) throws GErrorException
      Finish an asynchronous operation started with webkit_website_data_manager_fetch().
      Parameters:
      result - a GAsyncResult
      Returns:
      a GList of WebKitWebsiteData. You must free the GList with g_list_free() and unref the WebKitWebsiteDatas with webkit_website_data_unref() when you're done with them.
      Throws:
      GErrorException - see GError
      Since:
      2.16
    • getBaseCacheDirectory

      public @Nullable String getBaseCacheDirectory()
      Get the WebKitWebsiteDataManager:base-cache-directory property.
      Returns:
      the base directory for caches, or null if WebKitWebsiteDataManager:base-cache-directory was not provided or this WebsiteDataManager is ephemeral.
      Since:
      2.10
    • getBaseDataDirectory

      public @Nullable String getBaseDataDirectory()
      Get the WebKitWebsiteDataManager:base-data-directory property.
      Returns:
      the base directory for website data, or null if WebKitWebsiteDataManager:base-data-directory was not provided or this WebsiteDataManager is ephemeral.
      Since:
      2.10
    • getFaviconDatabase

      public @Nullable FaviconDatabase getFaviconDatabase()
      Get the WebKitFaviconDatabase of manager.
      Returns:
      a WebKitFaviconDatabase, or null if website icons are disabled
      Since:
      2.40
    • getFaviconsEnabled

      public boolean getFaviconsEnabled()
      Get whether website icons are enabled.
      Returns:
      true if website icons are enabled, or false otherwise.
      Since:
      2.40
    • getItpSummary

      public void getItpSummary(@Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback)

      Asynchronously get the list of WebKitITPThirdParty seen for manager.

      Every WebKitITPThirdParty contains the list of WebKitITPFirstParty under which it has been seen.

      When the operation is finished, callback will be called. You can then call webkit_website_data_manager_get_itp_summary_finish() to get the result of the operation.

      Parameters:
      cancellable - a GCancellable or null to ignore
      callback - a GAsyncReadyCallback to call when the request is satisfied
      Since:
      2.30
    • getItpSummaryFinish

      public List<ITPThirdParty> getItpSummaryFinish(AsyncResult result) throws GErrorException
      Finish an asynchronous operation started with webkit_website_data_manager_get_itp_summary().
      Parameters:
      result - a GAsyncResult
      Returns:
      a GList of WebKitITPThirdParty. You must free the GList with g_list_free() and unref the WebKitITPThirdPartys with webkit_itp_third_party_unref() when you're done with them.
      Throws:
      GErrorException - see GError
      Since:
      2.30
    • isEphemeral

      public boolean isEphemeral()

      Get whether a WebKitWebsiteDataManager is ephemeral.

      See WebKitWebsiteDataManager:is-ephemeral for more details.

      Returns:
      true if this WebsiteDataManager is ephemeral or false otherwise.
      Since:
      2.16
    • remove

      public void remove(Set<WebsiteDataTypes> types, List<WebsiteData> websiteData, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback)

      Asynchronously removes the website data in the given websiteData list.

      Asynchronously removes the website data of the given types for websites in the given websiteData list. Use webkit_website_data_manager_clear() if you want to remove the website data for all sites.

      When the operation is finished, callback will be called. You can then call webkit_website_data_manager_remove_finish() to get the result of the operation.

      Parameters:
      types - WebKitWebsiteDataTypes
      websiteData - a GList of WebKitWebsiteData
      cancellable - a GCancellable or null to ignore
      callback - a GAsyncReadyCallback to call when the request is satisfied
      Since:
      2.16
    • remove

      public void remove(WebsiteDataTypes types, List<WebsiteData> websiteData, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback)

      Asynchronously removes the website data in the given websiteData list.

      Asynchronously removes the website data of the given types for websites in the given websiteData list. Use webkit_website_data_manager_clear() if you want to remove the website data for all sites.

      When the operation is finished, callback will be called. You can then call webkit_website_data_manager_remove_finish() to get the result of the operation.

      Parameters:
      types - WebKitWebsiteDataTypes
      websiteData - a GList of WebKitWebsiteData
      cancellable - a GCancellable or null to ignore
      callback - a GAsyncReadyCallback to call when the request is satisfied
      Since:
      2.16
    • removeFinish

      public boolean removeFinish(AsyncResult result) throws GErrorException
      Finish an asynchronous operation started with webkit_website_data_manager_remove().
      Parameters:
      result - a GAsyncResult
      Returns:
      true if website data resources were successfully removed, or false otherwise.
      Throws:
      GErrorException - see GError
      Since:
      2.16
    • setFaviconsEnabled

      public void setFaviconsEnabled(boolean enabled)
      Set whether website icons are enabled. Website icons are disabled by default. When website icons are disabled, the WebKitFaviconDatabase of this WebsiteDataManager is closed and its reference removed, so webkit_website_data_manager_get_favicon_database() will return null. If website icons are enabled again, a new WebKitFaviconDatabase will be created.
      Parameters:
      enabled - value to set
      Since:
      2.40
    • builder

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