|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bumptech.glide.load.model.GlideUrl
public class GlideUrl
A wrapper for strings representing http/https URLs responsible for ensuring URLs are properly escaped and avoiding unnecessary URL instantiations for loaders that require only string urls rather than URL objects.
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 Summary | |
---|---|
GlideUrl(String url)
|
|
GlideUrl(String url,
Headers headers)
|
|
GlideUrl(URL url)
|
|
GlideUrl(URL url,
Headers headers)
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public GlideUrl(URL url)
public GlideUrl(String url)
public GlideUrl(URL url, Headers headers)
public GlideUrl(String url, Headers headers)
Method Detail |
---|
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 Map<String,String> getHeaders()
Map
containing headers.
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.
public String toString()
toString
in class Object
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |