Package com.bumptech.glide.load.model
Class GlideUrl
java.lang.Object
com.bumptech.glide.load.model.GlideUrl
- All Implemented Interfaces:
Key
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.
-
Field Summary
Fields inherited from interface com.bumptech.glide.load.Key
CHARSET, STRING_CHARSET_NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanFor caching to work correctly, implementations must implement this method andKey.hashCode().Returns an inexpensive to calculateStringsuitable for use as a disk cache key.Returns a non-nullMapcontaining headers.inthashCode()For caching to work correctly, implementations must implement this method andKey.equals(Object).toString()Returns a properly escapedStringurl that can be used to make http/https requests.toURL()voidupdateDiskCacheKey(MessageDigest messageDigest) Adds all uniquely identifying information to the given digest.
-
Constructor Details
-
GlideUrl
-
GlideUrl
-
GlideUrl
-
GlideUrl
-
-
Method Details
-
toURL
- Throws:
MalformedURLException
-
toStringUrl
Returns a properly escapedStringurl that can be used to make http/https requests.- See Also:
-
getHeaders
Returns a non-nullMapcontaining headers. -
getCacheKey
Returns an inexpensive to calculateStringsuitable for use as a disk cache key.This method does not include headers.
Unlike
toStringUrl()} andtoURL(), this method does not escape input. -
toString
-
updateDiskCacheKey
Description copied from interface:KeyAdds all uniquely identifying information to the given digest.Note - Using
MessageDigest.reset()inside of this method will result in undefined behavior.- Specified by:
updateDiskCacheKeyin interfaceKey
-
equals
Description copied from interface:KeyFor caching to work correctly, implementations must implement this method andKey.hashCode(). -
hashCode
public int hashCode()Description copied from interface:KeyFor caching to work correctly, implementations must implement this method andKey.equals(Object).
-