class AssetRenditionsZipperImpl implements AssetRenditionsDownloadOrchestrator {

    protected String getZipEntryName(final String folderName, final AssetModel asset, final String renditionName,
                                     final String responseContentType, final Set<String> zipEntryFileNames) {
        final String extension = mimeTypeService.getExtension(responseContentType);

        final Map<String, String> variables = new HashMap<>();

        variables.put(VAR_ASSET_FILE_NAME, asset.getName());
        variables.put(VAR_ASSET_NAME, StringUtils.substringBeforeLast(asset.getName(), "."));
        variables.put(VAR_ASSET_TITLE, asset.getTitle());
        variables.put(VAR_ASSET_EXTENSION, StringUtils.substringAfterLast(asset.getName(), "."));
        variables.put(VAR_RENDITION_NAME, renditionName);
        variables.put(VAR_RENDITION_EXTENSION, extension);

        String zipEntryName = StringUtils.replaceEach(cfg.rendition_filename_expression(),
                variables.keySet().toArray(new String[variables.keySet().size()]),
                variables.values().toArray(new String[variables.values().size()]));

        zipEntryName = generateUniqueZipEntry(zipEntryName, zipEntryFileNames);
        if (folderName != null) {
            zipEntryFileNames.add(folderName + "/" + zipEntryName);
        } else {
            zipEntryFileNames.add(zipEntryName);
        }

        return zipEntryName;
    }

}