Created
February 18, 2016 14:56
-
-
Save rcampbell/7fb74a8fa6bbd5ac2f02 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RequestMapping("zencoder.htm") | |
public void zen(final HttpServletRequest request, final HttpServletResponse response) throws AttachSystemFileException, IOException { | |
final String body = IOUtils.toString(request.getReader()); | |
logger.info("Received Zencoder notification:\n" + body); | |
final Notification notification = zen.notification(body); | |
final Job job = notification.getJob(); | |
final Output output = notification.getOutput(); | |
final String filename = decodeLabel(output.getLabel()); | |
if (job.isFinished()) { | |
logger.debug("zen CALL downloader.execute filename: " + filename); | |
downloader.execute(newDownloader(filename, notification)); | |
} else if (job.isFailed()) { | |
videoService.encodingFailed(filename, output.getErrorMessage(), output.getErrorLink()); | |
} | |
replyOk(response); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment