-
- All Implemented Interfaces:
-
android.os.Parcelable
public class Url implements Parcelable
A Uniform Resource Locator.
https://url.spec.whatwg.org/
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classUrl.Companionpublic final classUrl.QueryRepresents a list of query parameters in a URL.
public final classUrl.QueryParameterRepresents a single query parameter and its value in a URL.
public final classUrl.SchemeA URL scheme, e.g. http or file.
-
Method Summary
Modifier and Type Method Description final StringgetPath()final StringgetFilename()final FileExtensiongetExtension()final Url.QuerygetQuery()final StringgetFragment()final UrlremoveQuery()Returns a copy of this URL after dropping its query. final UrlremoveFragment()Returns a copy of this URL after dropping its fragment. Urlresolve(Url url)Resolves the given url to this URL. Urlrelativize(Url url)Relativizes the given url against this URL. StringtoString()Booleanequals(Object other)IntegerhashCode()-
-
Method Detail
-
getFilename
final String getFilename()
-
getExtension
final FileExtension getExtension()
-
getFragment
final String getFragment()
-
removeQuery
final Url removeQuery()
Returns a copy of this URL after dropping its query.
-
removeFragment
final Url removeFragment()
Returns a copy of this URL after dropping its fragment.
-
resolve
Url resolve(Url url)
Resolves the given url to this URL.
For example: this = "http://example.com/foo/" url = "bar/baz" result = "http://example.com/foo/bar/baz"
-
relativize
Url relativize(Url url)
Relativizes the given url against this URL.
For example: this = "http://example.com/foo" url = "http://example.com/foo/bar/baz" result = "bar/baz"
-
-
-
-