class UpdateFileTypeAPIController {

    @RequestMapping(value = "/file/bulk/type/{fileType}", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
    @ResponseBody
    public List<EcmFile> bulkUpdateFileType(@RequestBody List<Long> fileIds, @PathVariable("fileType") String fileType,
            Authentication authentication, HttpSession session)
    {

        log.debug("Updating file type to '{}' for multiple files.", fileType);

        List<EcmFile> files = new ArrayList<>();

        if (fileIds != null)
        {
            files = fileIds.stream().map(fileId -> updateFileType(fileId, fileType)).filter(file -> file != null)
                    .collect(Collectors.toList());
        }

        return files;
    }

}