Class GitLabAvatarCache

java.lang.Object
io.jenkins.plugins.gitlabbranchsource.helpers.GitLabAvatarCache
All Implemented Interfaces:
ExtensionPoint, Action, ModelObject, RootAction, UnprotectedRootAction

@Extension public class GitLabAvatarCache extends Object implements UnprotectedRootAction
An avatar cache that will serve URLs that have been recently registered through buildUrl(String, String)
  • Field Details

    • LOGGER

      public static final Logger LOGGER
      Our logger.
  • Constructor Details

    • GitLabAvatarCache

      public GitLabAvatarCache()
      Constructor.
  • Method Details

    • buildUrl

      public static String buildUrl(String url, String size)
      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.
    • getIconFileName

      public String getIconFileName()
      Specified by:
      getIconFileName in interface Action
    • getDisplayName

      public String getDisplayName()
      Specified by:
      getDisplayName in interface Action
      Specified by:
      getDisplayName in interface ModelObject
    • getUrlName

      public String getUrlName()
      Specified by:
      getUrlName in interface Action
    • doDynamic

      public org.kohsuke.stapler.HttpResponse doDynamic(org.kohsuke.stapler.StaplerRequest req, @QueryParameter String size)
      Serves the cached image.
      Parameters:
      req - the request.
      size - the requested size (defaults to 48x48 if unspecified).
      Returns:
      the response.