code: public static String getDefaultMimeByExtension(String filename) {
          String type = null;
  
          if (filename != null) {
              int i = -1;
              while (type == null) {
                  i = filename.indexOf(".", i + 1);
  
                  if (i < 0 || i >= filename.length())
                      break;
  
                  String ext = StringUtils.asciiToLowerCase(filename.substring(i + 1));
                  type = __dftMimeMap.get(ext);
              }
          }
  
          if (type == null) {
              type = __dftMimeMap.get("*");
          }
  
          return type;
      }
docs: Get the MIME type by filename extension.
  Lookup only the static default mime map.
  
  @param filename A file name
  @return MIME type matching the longest dot extension of the
  file name.