Package jenkins.scm.impl.avatars
Class AvatarCache
java.lang.Object
jenkins.scm.impl.avatars.AvatarCache
- All Implemented Interfaces:
- ExtensionPoint,- Action,- ModelObject,- RootAction,- UnprotectedRootAction
An avatar cache that will serve URLs that have been recently registered through 
buildUrl(String, String).- Since:
- 2.2.0
- 
Nested Class SummaryNested classes/interfaces inherited from interface hudson.ExtensionPointExtensionPoint.LegacyInstancesAreScopedToHudson
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic StringBuilds the URL for the cached avatar image of the required size.static StringbuildUrl(AvatarImageSource source, String size) Builds the URL for the cached avatar image of the required size.org.kohsuke.stapler.HttpResponseServes the cached image.
- 
Constructor Details- 
AvatarCachepublic AvatarCache()Constructor.
 
- 
- 
Method Details- 
buildUrlBuilds the URL for the cached avatar image of the required size.- Parameters:
- url- the URL of the source avatar image.
- size- the size of the image.
- Returns:
- the URL of the cached image.
- Throws:
- IllegalStateException- if called outside of a request handling thread.
 
- 
buildUrlBuilds the URL for the cached avatar image of the required size.- Parameters:
- source- source avatar image definition.
- size- the size of the image.
- Returns:
- the URL of the cached image.
- Throws:
- IllegalStateException- if called outside of a request handling thread.
 
- 
getIconFileName- Specified by:
- getIconFileNamein interface- Action
 
- 
getDisplayName- Specified by:
- getDisplayNamein interface- Action
- Specified by:
- getDisplayNamein interface- ModelObject
 
- 
getUrlName- Specified by:
- getUrlNamein interface- Action
 
- 
doDynamicpublic org.kohsuke.stapler.HttpResponse doDynamic(org.kohsuke.stapler.StaplerRequest2 req, @QueryParameter String size) Serves the cached image.- Parameters:
- req- the request.
- size- the requested size (defaults to- 48x48if unspecified).
- Returns:
- the response.
 
 
-