-
public final class UrlKt
-
-
Method Summary
Modifier and Type Method Description final static UrlfromLegacyHref(Url.Companion $self, String href)Creates an Url from a legacy HREF. final static UrlfromEpubHref(Url.Companion $self, String href)According to the EPUB specification, the HREFs in the EPUB package must be valid URLs (so percent-encoded). final static AbsoluteUrltoUrl(File $self)final static UrltoUrl(Uri $self)final static UrltoUrl(URL $self)final static UrltoUrl(URI $self)final static AbsoluteUrltoAbsoluteUrl(Uri $self)final static AbsoluteUrltoAbsoluteUrl(URL $self)final static RelativeUrltoRelativeUrl(Uri $self)final static RelativeUrltoRelativeUrl(URL $self)final static UritoUri(Url $self)final static StringappendToFilename(FileExtension $self, String filename)Appends this file extension to filename. -
-
Method Detail
-
fromLegacyHref
final static Url fromLegacyHref(Url.Companion $self, String href)
Creates an Url from a legacy HREF.
For example, if it is a relative path such as
/dir/my chapter.html, it will be converted to the valid relative URLdir/my%20chapter.html.Only use this API when you are upgrading to Readium 3.x and migrating the HREFs stored in your database. See the 3.0 migration guide for more information.
-
fromEpubHref
final static Url fromEpubHref(Url.Companion $self, String href)
According to the EPUB specification, the HREFs in the EPUB package must be valid URLs (so percent-encoded). Unfortunately, many EPUBs don't follow this rule, and use invalid HREFs such as
my chapter.htmlor/dir/my chapter.html.As a workaround, we assume the HREFs are valid percent-encoded URLs, and fallback to decoded paths if we can't parse the URL.
-
toUrl
final static AbsoluteUrl toUrl(File $self)
-
toAbsoluteUrl
final static AbsoluteUrl toAbsoluteUrl(Uri $self)
-
toAbsoluteUrl
final static AbsoluteUrl toAbsoluteUrl(URL $self)
-
toRelativeUrl
final static RelativeUrl toRelativeUrl(Uri $self)
-
toRelativeUrl
final static RelativeUrl toRelativeUrl(URL $self)
-
appendToFilename
final static String appendToFilename(FileExtension $self, String filename)
Appends this file extension to filename.
-
-
-
-