@RestController public class StreamingController extends Object
Based on Omnifaces FileServlet.java (Apache License 2.0)
This implementation properly deals with ETag, If-None-Match and
If-Modified-Since caching requests, hereby improving browser caching. This servlet also properly deals
with Range and If-Range ranging requests
(RFC7233), which is required by most media players for proper
audio/video streaming, and by webbrowsers and for a proper resume of an paused download, and by download accelerators
to be able to request smaller parts simultaneously. This implementaion is ideal when you have large files like media
files placed outside the web application and you can't use the default servlet.
| Modifier and Type | Class and Description |
|---|---|
protected class |
StreamingController.Range
This class represents a byte range.
|
| Constructor and Description |
|---|
StreamingController() |
| Modifier and Type | Method and Description |
|---|---|
void |
getHead(String id,
String extension,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
void |
getStream(String id,
String extension,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
@RequestMapping(value="/stream/{id}/default.{extension}",
method=HEAD)
public void getHead(@PathVariable
String id,
@PathVariable
String extension,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws Exception
ExceptionCopyright © 2018. All rights reserved.