code: public static String getExtension(File file) {
      Assert.notNull(file, "File cannot be null");
      String filename = file.getName();
      int dotIndex = filename.indexOf(StringUtils.DOT_SEPARATOR);
      return (dotIndex != -1 ? filename.substring(dotIndex + 1) : StringUtils.EMPTY_STRING);
    }
docs: Returns the extension of the given file.
  
  @param file the {@link File} from which to get the extension.
  @return the file extension of the given file or an empty String if the file does not have an extension.
  @throws java.lang.NullPointerException if the file reference is null.
  @see java.io.File#getName()