@RequestMapping( value = "/contacts/files/{contactId}/attachments/{attachmentId}/check", method = GET) public void checkFile(@PathVariable Long contactId, @PathVariable Long attachmentId) { logger.debug("checking attachment {} from contact {}", attachmentId, contactId); File file = fileService.getAttachment(contactId, attachmentId); if (!file.exists()) { throw new RuntimeException("error happened during file download"); } }