class GetTotalPageCountAPIController {

    @RequestMapping(value = "/totalpagecount/{parentObjectType}/{parentObjectId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
    @ResponseBody
    public int getTotalPageCount(@PathVariable("parentObjectType") String parentObjectType,
            @PathVariable("parentObjectId") Long parentObjectId,
            @RequestParam(value = "fileTypes", required = false, defaultValue = "") String fileTypes,
            @RequestParam(value = "mimeTypes", required = false, defaultValue = "") String mimeTypes, Authentication auth)
    {
        List<String> fileTypesList = Arrays.asList(fileTypes.split("\\s*,\\s*"));
        List<String> mimeTypesList = Arrays.asList(mimeTypes.split("\\s*,\\s*"));

        LOG.debug("File types: {}", fileTypesList);
        LOG.debug("Mime types: {}", mimeTypesList);

        return getEcmFileService().getTotalPageCount(parentObjectType, parentObjectId, fileTypesList, mimeTypesList, auth);
    }

}