Skip to content

UrlAsset

final class UrlAsset
Extends: Asset
Package: dev.joid.lib.asset.impl · Module: core · Source: UrlAsset.java

An asset read from a URL, over the network or from a file:, jar: or other scheme.

A String that starts with a scheme (https:, file:, jar:) gives one; its id is the URL. A connection waits 10 seconds to connect and 30 seconds for data; an https: URL that fails on a TLS error is tried once more over http:, and any other error goes up as it is.

ReturnsSignatureSummary
UrlAssetof(String url) factoryCreates the asset of url.

ReturnsSignatureSummary
InputStreamopen()Connects to the URL and returns its content.
FilegetFile()Returns the file of a file: URL, or null for any other URL or a file: URL that is not a valid file URI.
booleanisRemote()If true, the URL is neither file: nor jar: and is read on a background thread.
StringgetUrl()Returns the URL.
Inherited from Asset (4)

peek · read · toString · getUniqueId

UrlAsset of(String url) factory

Creates the asset of url.

InputStream open()

Connects to the URL and returns its content. Throws IOException when the connection or the transfer fails; for the http: retry, its failure is added as suppressed to the TLS error.

File getFile()

Returns the file of a file: URL, or null for any other URL or a file: URL that is not a valid file URI.

boolean isRemote()

If true, the URL is neither file: nor jar: and is read on a background thread.

String getUrl()

Returns the URL.


fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses

Report a problem with this page