code: public static String getMimeTypeForFileName(String fileName) {
  		int extensionPos = fileName.lastIndexOf('.');
  		if (extensionPos >= 1 && extensionPos < fileName.length() - 1) {
  			String extension = fileName.substring(extensionPos + 1);
  			return getMimeTypeForExtension(extension);
  		}
  		else {
  			return null;
  		}
  	}
docs: Gets the MIME type for the file with the given name, by extension. This method tries to extract
  the file extension and then use the {@link #getMimeTypeForExtension(String)} to determine the
  MIME type. If the extension cannot be determined, or the extension is unrecognized, this method
  return {@code null}.
  
  @param fileName The file name.
  @return The MIME type, or {@code null}, if the file's extension is not recognized.