class AssetRenditionsDownloadServlet extends SlingAllMethodsServlet implements AssetRenditionsDownloadOrchestratorManager {

    protected List<String> getRenditionNames(final SlingHttpServletRequest request) {
        final String[] allowedRenditionNames = request.getResource().getValueMap().get(PN_ALLOWED_RENDITION_NAMES, new String[]{});

        if (allowedRenditionNames == null) { return EMPTY_LIST; }

        final RequestParameter[] requestParameters = request.getRequestParameters(REQ_KEY_RENDITION_NAMES);

        if (requestParameters != null) {
            return Arrays.stream(requestParameters).map(RequestParameter::getString)
                    .filter(renditionName -> allowedRenditionNames.length == 0 || ArrayUtils.contains(allowedRenditionNames, renditionName))
                    .distinct()
                    .collect(Collectors.toList());
        } else {
            return emptyList();
        }
    }

}