code: public String getMimeType(String filename, String defaultMimeType) {
          Matcher matcher = extPattern.matcher(filename.toLowerCase());
          String ext = "";
          if (matcher.matches()) {
              ext = matcher.group(1);
          }
          if (ext.length() > 0) {
              String mimeType = mimetypes.getProperty(ext);
              if (mimeType == null) {
                  return defaultMimeType;
              }
              return mimeType;
          }
          return defaultMimeType;
      }
docs: return the mimetype from a file name.<br/>
  
  @param filename
  the file name
  @param defaultMimeType
  the default mime type to return when no matching mimetype is
  found
  @return the mimetype