Class UserProfileAvatarResource

java.lang.Object
com.atlassian.bamboo.plugins.rest.resource.UserProfileAvatarResource

@Path("avatar/user") @Consumes("*/*") @Produces("*/*") @Singleton public class UserProfileAvatarResource extends Object
  • Field Details

    • LAST_MODIFIED_DATE_FORMAT

      public static final SimpleDateFormat LAST_MODIFIED_DATE_FORMAT
  • Constructor Details

  • Method Details

    • retrieveAvatar

      @GET @Path("{userName}/avatar.png") public javax.ws.rs.core.Response retrieveAvatar(@PathParam("userName") String userName, @QueryParam("s") @DefaultValue("256") int size, @Context javax.servlet.http.HttpServletRequest request)
    • uploadAvatar

      @PUT @Path("avatar.png") @Consumes("multipart/form-data") public javax.ws.rs.core.Response uploadAvatar(com.atlassian.plugins.rest.api.multipart.FilePart file)
    • deleteAvatar

      @DELETE @Path("avatar.png") public javax.ws.rs.core.Response deleteAvatar()
    • streamAvatar

      protected javax.ws.rs.core.Response streamAvatar(CacheableAvatarSupplier supplier, javax.servlet.http.HttpServletRequest request)
      Streams the provided avatar, automatically handling "If-Modified-Since" and "Last-Modified" headers to encourage browsers to cache avatars.
      Parameters:
      supplier - a supplier providing access to the avatar data to stream
      request - the HTTP request to retrieve the avatar
      Throws:
      IOException - if the avatar cannot be read from the provided supplier, or written to the provided response