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