code: public static String getFilenameExtension(String path) {
          if (path == null) return null;
  
          int extIndex = path.lastIndexOf(EXTENSION_SEPARATOR);
          if (extIndex == -1) return null;
  
          int folderIndex = path.lastIndexOf(FOLDER_SEPARATOR);
          if (folderIndex > extIndex) return null;
  
          return path.substring(extIndex + 1);
      }
docs: Extract the filename extension from the given Java resource path, e.g. "mypath/myfile.txt" -> "txt".
  
  @param path the file path (may be null).
  
  @return the extracted filename extension, or null if none.