code: public static String getExtension(File f) {
          String ext = null;
          
          String name = f.getName();
          int i = name.lastIndexOf('.');
  
          if (i > 0 &&  i < name.length() - 1) {
              ext = name.substring(i+1).toLowerCase();
          }
          
          return ext;
      }
docs: *
  Get the text after the final dot (.) in the file name.
  @param f The file to get the extension of.
  @return The extension of File f.