Class TempMediaFileResource
java.lang.Object
io.goobi.viewer.api.rest.v1.media.TempMediaFileResource
Upload of resouces for DC record creation. Files uploaded here are directly written to a subfolder of the viewer hotfolder
- Author:
- florian
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected jakarta.servlet.http.HttpServletRequest
protected jakarta.servlet.http.HttpServletResponse
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjakarta.ws.rs.core.Response
deleteUploadedFiles
(String folder) Delete all files uploaded for the given folder.static String
errorMessage
(String string) static Path
getTargetDir
(String foldername) Get the appropriate media subfolder for foldername in the viewer hotfolder.jakarta.ws.rs.core.Response
getUploadedFiles
(String folder) Get a filename list of all uploaded files in the media directory of the given folder.static String
jakarta.ws.rs.core.Response
uploadMediaFiles
(String foldername, boolean enabled, String filename, InputStream uploadedInputStream, org.glassfish.jersey.media.multipart.FormDataContentDisposition fileDetail) Upload a file to the hotfolder.
-
Field Details
-
servletRequest
@Context protected jakarta.servlet.http.HttpServletRequest servletRequest -
servletResponse
@Context protected jakarta.servlet.http.HttpServletResponse servletResponse
-
-
Constructor Details
-
TempMediaFileResource
public TempMediaFileResource()
-
-
Method Details
-
uploadMediaFiles
@POST @Path("/{folder}") @Consumes("multipart/form-data") @Produces("application/json") public jakarta.ws.rs.core.Response uploadMediaFiles(@PathParam("folder") String foldername, @DefaultValue("true") boolean enabled, String filename, InputStream uploadedInputStream, org.glassfish.jersey.media.multipart.FormDataContentDisposition fileDetail) Upload a file to the hotfolder.- Parameters:
foldername
-enabled
-filename
-uploadedInputStream
-fileDetail
-- Returns:
- a json response with a result message
-
getUploadedFiles
@GET @Path("/{folder}") @Produces("application/json") public jakarta.ws.rs.core.Response getUploadedFiles(@PathParam("folder") String folder) Get a filename list of all uploaded files in the media directory of the given folder.- Parameters:
folder
-- Returns:
- a filename list of all uploaded files in the media folder
-
deleteUploadedFiles
@DELETE @Path("/{folder}") @Produces("application/json") public jakarta.ws.rs.core.Response deleteUploadedFiles(@PathParam("folder") String folder) Delete all files uploaded for the given folder.- Parameters:
folder
-- Returns:
- a 200 response if deletion was successful, otherwise 500
-
errorMessage
-
message
-
getTargetDir
Get the appropriate media subfolder for foldername in the viewer hotfolder.- Parameters:
foldername
-- Returns:
- the folder for upload
- Throws:
IOException
-