class FilenameVariantConverter {

    public String toVariantFileName(String fileName, String variant) {
        if (variant==null || variant.isEmpty()) {
            return fileName;
        }
        if (fileName == null) {
            throw new IllegalArgumentException("filename may not be null!");
        }
        int index = fileName.indexOf('.');
        if (index == -1) {
            throw new IllegalArgumentException("no '.' found, so not able to create variant file name!");
        }
        String postfix = fileName.substring(index);
        String prefix = fileName.substring(0, index);

        return prefix + variantIdentifier + variant + postfix;
    }

    public  FilenameVariantConverter();
    public  FilenameVariantConverter(String varIdentifier);

}