code: public static String changeFileNameSuffixTo(String filename, String suffix) {
  
          int dotPos = filename.lastIndexOf('.');
          if (dotPos != -1) {
              return filename.substring(0, dotPos + 1) + suffix;
          } else {
              // the string has no suffix
              return filename;
          }
      }
docs: Changes the given filenames suffix from the current suffix to the provided suffix.
  
  <b>Directly exposed for JSP EL</b>, not through {@link org.opencms.jsp.util.CmsJspElFunctions}.<p>
  
  @param filename the filename to be changed
  @param suffix the new suffix of the file
  
  @return the filename with the replaced suffix