public class GlideUrl extends Object
Users wishing to replace the class for handling URLs must register a factory using GlideUrl.
To obtain a properly escaped URL, call toURL()
. To obtain a properly escaped string URL, call
toStringUrl()
. To obtain a less safe, but less expensive to calculate cache key, call
getCacheKey()
.
This class can also optionally wrap Headers
for convenience.
Constructor and Description |
---|
GlideUrl(String url) |
GlideUrl(String url,
Headers headers) |
GlideUrl(URL url) |
GlideUrl(URL url,
Headers headers) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
String |
getCacheKey()
Returns an inexpensive to calculate
String suitable for use as a disk cache key. |
Map<String,String> |
getHeaders()
Returns a non-null
Map containing headers. |
int |
hashCode() |
String |
toString() |
String |
toStringUrl()
Returns a properly escaped
String url that can be used to make http/https requests. |
URL |
toURL()
Returns a properly escaped
URL that can be used to make http/https requests. |
public URL toURL() throws MalformedURLException
URL
that can be used to make http/https requests.MalformedURLException
toStringUrl()
,
getCacheKey()
public String toStringUrl()
String
url that can be used to make http/https requests.toURL()
,
getCacheKey()
public String getCacheKey()
String
suitable for use as a disk cache key.
This method does not include headers.
Unlike toStringUrl()
} and toURL()
, this method does not escape input.