Class UserAvatarResource
java.lang.Object
de.unigoettingen.sub.commons.contentlib.servlet.rest.ContentServerResource
de.unigoettingen.sub.commons.contentlib.servlet.rest.ImageResource
io.goobi.viewer.api.rest.v1.authentication.UserAvatarResource
@Path("/users/{userId}/avatar")
public class UserAvatarResource
extends de.unigoettingen.sub.commons.contentlib.servlet.rest.ImageResource
- Author:
- florian
-
Nested Class Summary
Nested classes/interfaces inherited from class de.unigoettingen.sub.commons.contentlib.servlet.rest.ImageResource
de.unigoettingen.sub.commons.contentlib.servlet.rest.ImageResource.ImageStreamingOutput, de.unigoettingen.sub.commons.contentlib.servlet.rest.ImageResource.PdfStreamingOutput
Nested classes/interfaces inherited from class de.unigoettingen.sub.commons.contentlib.servlet.rest.ContentServerResource
de.unigoettingen.sub.commons.contentlib.servlet.rest.ContentServerResource.ResourceStatus
-
Field Summary
Modifier and TypeFieldDescriptionprotected javax.servlet.http.HttpServletRequest
protected javax.servlet.http.HttpServletResponse
Fields inherited from class de.unigoettingen.sub.commons.contentlib.servlet.rest.ImageResource
BACKSLASH_REPLACEMENT, context, IIIF_VERSION, imageURI, PERCENT_REPLACEMENT, QUESTION_MARK_REPLACEMENT, request, REQUEST_ATTRIBUTE_ERROR, resourceURI, response, SLASH_REPLACEMENT
Fields inherited from class de.unigoettingen.sub.commons.contentlib.servlet.rest.ContentServerResource
MEDIA_TYPE_APPLICATION_JSONLD, REQUEST_TYPE_IMAGE, REQUEST_TYPE_METSPDF, REQUEST_TYPE_PDF, requestId, requestMap
-
Constructor Summary
ConstructorDescriptionUserAvatarResource
(javax.ws.rs.container.ContainerRequestContext context, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Long userId) -
Method Summary
Modifier and TypeMethodDescriptionvoid
createResourceURI
(javax.servlet.http.HttpServletRequest request, String directory, String filename) static Path
getAvatarFilePath
(String uploadFilename, Long userId) static String
getAvatarFileSuffix
(Long userId) static URI
getMediaFileUrl
(Long userId) getUserAvatarFile
(Long userId) static Path
javax.ws.rs.core.Response
static void
removeFromImageCache
(Path file) javax.ws.rs.core.Response
uploadAvatarFile
(boolean enabled, String uploadFilename, InputStream uploadedInputStream, org.glassfish.jersey.media.multipart.FormDataContentDisposition fileDetail) Methods inherited from class de.unigoettingen.sub.commons.contentlib.servlet.rest.ImageResource
addContentHeader, createImageURI, getCache, getCachedDate, getGif, getImage, getImageURI, getInfoAsJson, getInfoAsXml, getPdf, getPdf, getRequestedWidth, getResourceURI, getURIPrefix, isInCache, redirectToFullImage, redirectToFullImage, setImageURI, setInitializationException, setResourceURI, unescape
Methods inherited from class de.unigoettingen.sub.commons.contentlib.servlet.rest.ContentServerResource
checkMemoryOverflow, checkRequestOverflow, finishRequest, getNumCurrentFooterRequests, getNumCurrentImageRequests, getNumCurrentMetsPdfRequests, getNumCurrentRequests, getNumCurrentSinglePdfRequests, getRequestId, getStatus, remainingMemory, startRequest
-
Field Details
-
servletRequest
@Context protected javax.servlet.http.HttpServletRequest servletRequest -
servletResponse
@Context protected javax.servlet.http.HttpServletResponse servletResponse
-
-
Constructor Details
-
UserAvatarResource
public UserAvatarResource(@Context javax.ws.rs.container.ContainerRequestContext context, @Context javax.servlet.http.HttpServletRequest request, @Context javax.servlet.http.HttpServletResponse response, @PathParam("userId") Long userId) throws javax.ws.rs.WebApplicationException, ViewerConfigurationException - Throws:
javax.ws.rs.WebApplicationException
ViewerConfigurationException
-
-
Method Details
-
getMediaFileUrl
- Parameters:
userId
-- Returns:
URI
- Throws:
javax.ws.rs.WebApplicationException
-
getUserAvatarFolder
-
getUserAvatarFile
- Parameters:
userId
-- Returns:
- Optional
- Throws:
IOException
-
getAvatarFileSuffix
- Throws:
IOException
-
createResourceURI
public void createResourceURI(javax.servlet.http.HttpServletRequest request, String directory, String filename) throws de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException - Overrides:
createResourceURI
in classde.unigoettingen.sub.commons.contentlib.servlet.rest.ImageResource
- Throws:
de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException
-
redirectToCanonicalImageInfo
@GET @Produces({"application/json","application/ld+json"}) public javax.ws.rs.core.Response redirectToCanonicalImageInfo() throws de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException- Overrides:
redirectToCanonicalImageInfo
in classde.unigoettingen.sub.commons.contentlib.servlet.rest.ImageResource
- Throws:
de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException
-
uploadAvatarFile
@POST @Consumes("multipart/form-data") @Produces("application/json") public javax.ws.rs.core.Response uploadAvatarFile(@DefaultValue("true") boolean enabled, String uploadFilename, InputStream uploadedInputStream, org.glassfish.jersey.media.multipart.FormDataContentDisposition fileDetail) -
getAvatarFilePath
-
removeFromImageCache
-