Class MediaResource
java.lang.Object
io.goobi.viewer.api.rest.v1.media.MediaResource
REST resource for accessing and delivering audio and video media files associated with digitized records.
- Author:
- Florian Alpers
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckAccess(String action, String pi, String contentFilename) checkAccess.serveAudioContent(String format, String filename) serveMediaContent.serveVideoContent(String format, String filename) serveMediaContent.
-
Constructor Details
-
MediaResource
-
-
Method Details
-
serveAudioContent
@GET @Path("/audio/{mimetype}/{filename}") public String serveAudioContent(@PathParam("mimetype") String format, @PathParam("filename") String filename) throws PresentationException, IndexUnreachableException, AccessDeniedException serveMediaContent.- Parameters:
format- audio MIME subtype (e.g. mp3, ogg)filename- name of the audio resource file- Returns:
- the streamed audio content as a string response
- Throws:
PresentationException- if any.IndexUnreachableException- if any.AccessDeniedException- if any.
-
serveVideoContent
@GET @Path("/video/{mimetype}/{filename}") public String serveVideoContent(@PathParam("mimetype") String format, @PathParam("filename") String filename) throws PresentationException, IndexUnreachableException, WebApplicationException serveMediaContent.- Parameters:
format- video MIME subtype (e.g. mp4, webm)filename- name of the video resource file- Returns:
- the streamed video content as a string response
- Throws:
PresentationException- if any.IndexUnreachableException- if any.AccessDeniedException- if any.WebApplicationException
-
checkAccess
public void checkAccess(String action, String pi, String contentFilename) throws WebApplicationException checkAccess.- Parameters:
action- media type used as access action key (e.g. audio, video)pi- persistent identifier of the recordcontentFilename- filename of the requested media file- Throws:
AccessDeniedException- if any.WebApplicationException
-