Skip to content

Instantly share code, notes, and snippets.

@shazin
Created February 25, 2016 07:55
Show Gist options
  • Save shazin/52853a91083300c4b57d to your computer and use it in GitHub Desktop.
Save shazin/52853a91083300c4b57d to your computer and use it in GitHub Desktop.
@RequestMapping(method = RequestMethod.GET, value = "/{video:.+}")
public StreamingResponseBody stream(@PathVariable String video)
throws FileNotFoundException {
File videoFile = videos.get(video);
final InputStream videoFileStream = new FileInputStream(videoFile);
return (os) -> {
readAndWrite(videoFileStream, os);
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment