Class TempMediaImageResource
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.media.TempMediaImageResource
@Path("/temp/files/{folder}/{filename: [^\\/]*\\.([jJ][pP][eE]?[gG]|[tT][iI][fF][fF]?|[pP][nN][gG]|[gG][iI][fF]|[jJ][pP]2)}")
public class TempMediaImageResource
extends de.unigoettingen.sub.commons.contentlib.servlet.rest.ImageResource
- Author:
- Florian Alpers
-
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.PdfStreamingOutputNested classes/interfaces inherited from class de.unigoettingen.sub.commons.contentlib.servlet.rest.ContentServerResource
de.unigoettingen.sub.commons.contentlib.servlet.rest.ContentServerResource.ResourceStatus -
Field Summary
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_REPLACEMENTFields inherited from class de.unigoettingen.sub.commons.contentlib.servlet.rest.ContentServerResource
cacheManager, MEDIA_TYPE_APPLICATION_JSONLD, REQUEST_TYPE_IMAGE, REQUEST_TYPE_METSPDF, REQUEST_TYPE_PDF, requestId, requestMap -
Constructor Summary
ConstructorsConstructorDescriptionTempMediaImageResource(ContainerRequestContext context, HttpServletRequest request, HttpServletResponse response, String folder, String filename, de.unigoettingen.sub.commons.cache.ContentServerCacheManager cacheManager) -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateResourceURI(HttpServletRequest request, String directory, String filename) deleteUploadedFile(String folder, String filename) Deletes the file with the given filename in the temp media folder for the given uuid.Redirects to the canonicalinfo.jsonurl of this temporary image resource.Methods inherited from class de.unigoettingen.sub.commons.contentlib.servlet.rest.ImageResource
addContentHeader, createImageURI, createResourceURI, getCache, getCachedDate, getGif, getImage, getImageURI, getInfoAsJson, getInfoAsXml, getPdf, getPdf, getRequestedWidth, getResourceURI, getURIPrefix, isInCache, redirectToFullImage, setImageURI, setInitializationException, setResourceURI, unescapeMethods inherited from class de.unigoettingen.sub.commons.contentlib.servlet.rest.ContentServerResource
checkMemoryOverflow, checkRequestOverflow, finishRequest, getNumCurrentFooterRequests, getNumCurrentImageRequests, getNumCurrentMetsPdfRequests, getNumCurrentRequests, getNumCurrentSinglePdfRequests, getRequestId, getStatus, remainingMemory, startRequest
-
Constructor Details
-
TempMediaImageResource
public TempMediaImageResource(@Context ContainerRequestContext context, @Context HttpServletRequest request, @Context HttpServletResponse response, @PathParam("folder") String folder, @PathParam("filename") String filename, @Context de.unigoettingen.sub.commons.cache.ContentServerCacheManager cacheManager)
-
-
Method Details
-
createResourceURI
public void createResourceURI(HttpServletRequest request, String directory, String filename) throws de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException - Overrides:
createResourceURIin 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 Response redirectToCanonicalImageInfo() throws de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibExceptionRedirects to the canonicalinfo.jsonurl of this temporary image resource.- Overrides:
redirectToCanonicalImageInfoin classde.unigoettingen.sub.commons.contentlib.servlet.rest.ImageResource- Returns:
- a 303 redirect response
- Throws:
de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException
-
deleteUploadedFile
@DELETE @Produces("application/json") public Response deleteUploadedFile(@PathParam("folder") String folder, @PathParam("filename") String filename) Deletes the file with the given filename in the temp media folder for the given uuid.- Parameters:
folder- temp folder UUID identifying the upload sessionfilename- name of the file to delete- Returns:
- A 200 "OK" answer if deletion was successfull, 406 if the file was not found and 500 if there was an error
-