class FilenameVariantConverter {

    public String getFilenameWithoutVariant(String fileName) {
        if (fileName == null) {
            return null;
        }
        int index = fileName.indexOf(variantIdentifier);
        if (index == -1) {
            return fileName;
        }
        String before = fileName.substring(0,index);
        String subString = fileName.substring(index + variantIdentifier.length());
        index = subString.indexOf('.');
        if (index == -1) {
          throw new IllegalArgumentException("no '.' found, but this is not allowed!");
        }
        String ending = subString.substring(index);
        return before+ending;
    }

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

}