TouchIconExtractor

class TouchIconExtractor(httpClient: HttpClientAdapter = SimpleHttpClientAdapterFactory.create())

Extract information of WebClip icon such as Apple Touch Icon or favicon related to the URL.

Parameters

httpClient

HttpClientAdapter to use for internal communication. if not specified use default implementation.

Constructors

Link copied to clipboard
constructor(httpClient: HttpClientAdapter = SimpleHttpClientAdapterFactory.create())

Initialize the instance. You can change HttpClientAdapter and HtmlParserAdapter.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Specify the maximum download size when downloading HTML file.

Link copied to clipboard

Specify the HTTP communication header.

Link copied to clipboard

Specify the value of User-Agent used for HTTP communication.

Functions

Link copied to clipboard
fun fromDomain(siteUrl: String, withPrecomposed: Boolean = true, sizes: List<String> = emptyList()): Icon?

Get valid icon information, by trying to access to some icon from the root of domain of specified URL.

Link copied to clipboard
fun fromDomainWithDownload(siteUrl: String, withPrecomposed: Boolean = true, sizes: List<String> = emptyList()): Pair<Icon, ByteArray>?

It performs the same processing as fromDomain using HTTP GET, and downloads binary if icon exists.

Link copied to clipboard
fun fromManifest(siteUrl: String): List<Icon>

Analyzes the HTML of specified URL and if there is a tag indicating WebApp Manifest, analyze the Manifest file and return icon information.

Link copied to clipboard
fun fromPage(siteUrl: String, withManifest: Boolean = false): List<Icon>

Analyzes the HTML of the specified URL and extract the icon information specified by the link tag.

Link copied to clipboard
fun listFromDomain(siteUrl: String, withPrecomposed: Boolean = true, sizes: List<String> = emptyList()): List<Icon>

Processing similar to fromDomain is performed, but even if an icon is found, processing is not stopped but a list of all existing icon information is returned.