Class TempMediaFileResource

java.lang.Object
io.goobi.viewer.api.rest.v1.media.TempMediaFileResource

@Path("/temp/files") public class TempMediaFileResource extends Object
Upload of resouces for DC record creation. Files uploaded here are directly written to a subfolder of the viewer hotfolder
Author:
florian
  • Field Details

    • servletRequest

      @Context protected javax.servlet.http.HttpServletRequest servletRequest
    • servletResponse

      @Context protected javax.servlet.http.HttpServletResponse servletResponse
  • Constructor Details

    • TempMediaFileResource

      public TempMediaFileResource()
  • Method Details

    • uploadMediaFiles

      @POST @Path("/{folder}") @Consumes("multipart/form-data") @Produces("application/json") public javax.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 javax.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 javax.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

      public static String errorMessage(String string)
    • message

      public static String message(String string)
    • getTargetDir

      public static Path getTargetDir(String foldername) throws IOException
      Get the appropriate media subfolder for foldername in the viewer hotfolder.
      Parameters:
      foldername -
      Returns:
      the folder for upload
      Throws:
      IOException