Class AvatarCache

    • Constructor Detail

      • AvatarCache

        public AvatarCache()
        Constructor.
    • Method Detail

      • buildUrl

        public static String buildUrl​(@NonNull
                                      String url,
                                      @NonNull
                                      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.
        Throws:
        IllegalStateException - if called outside of a request handling thread.
      • buildUrl

        public static String buildUrl​(@NonNull
                                      AvatarImageSource source,
                                      @NonNull
                                      String size)
        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.
      • 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.