code: public static String baseName(String file, @NonNull String suffix) {
        if (StringUtils.isNullOrBlank(file)) {
           return StringUtils.EMPTY;
        }
        file = StringUtils.trim(file);
        int index = indexOfLastSeparator(file);
        if (index == -1) {
           return file.replaceAll(Pattern.quote(suffix) + "$", "");
        } else if (index == file.length() - 1) {
           return baseName(file.substring(0, file.length() - 1));
        }
        return file.substring(index + 1).replaceAll(Pattern.quote(suffix) + "$", "");
     }
docs: <p>Attempts to get the base name for a given file/directory. Removes the suffix from the name as well. This
  command  should work in the same way as the unix <code>basename</code> command. </p>
  
  @param file   The file path/name
  @param suffix The  suffix to remove
  @return The file name if given a file, the directory name if given a directory, or null if given a null or empty
  string.