String (@NotNull String fileName, boolean caseSensitive, @NotNull FileTypeManager fileTypeManager) { // support multipart extensions like *.blade.php String extension = StringUtil.notNullize(PathUtilRt.getFileExtension(fileName)); if (extension.isEmpty()) return fileName; FileType fileType = fileTypeManager.getFileTypeByFileName(fileName); if (fileType != FileTypes.UNKNOWN) { extension = getFileTypeExtensions(fileType, false, fileTypeManager) .reduce(extension, (val, o) -> val.length() < o.length() && hasExtension(fileName, o, caseSensitive) ? o : val); } return fileName.substring(0, fileName.length() - extension.length() - 1); }