Class AvatarCache
java.lang.Object
com.cloudbees.jenkins.plugins.bitbucket.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 Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
buildUrl
(AvatarCacheSource source, String size) Builds the URL for the cached avatar image of the required size.static String
Builds the URL for the cached avatar image of the required size.org.kohsuke.stapler.HttpResponse
Serves the cached image.
-
Constructor Details
-
AvatarCache
public AvatarCache()Constructor.
-
-
Method Details
-
buildUrl
Builds 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.
-
buildUrl
Builds 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:
getIconFileName
in interfaceAction
-
getDisplayName
- Specified by:
getDisplayName
in interfaceAction
- Specified by:
getDisplayName
in interfaceModelObject
-
getUrlName
- Specified by:
getUrlName
in interfaceAction
-
doDynamic
public org.kohsuke.stapler.HttpResponse doDynamic(org.kohsuke.stapler.StaplerRequest req, @QueryParameter String requestedSize) Serves the cached image.- Parameters:
req
- the request.requestedSize
- the requested size (defaults to48x48
if unspecified).- Returns:
- the response.
-