docs: public String getMimeType(String filename, String encoding, String defaultMimeType) {
  
          String mimeType = null;
          int lastDot = filename.lastIndexOf('.');
          // check the MIME type for the file extension
          if ((lastDot > 0) && (lastDot < (filename.length() - 1))) {
              mimeType = m_mimeTypes.get(filename.substring(lastDot).toLowerCase(Locale.ENGLISH));
          }
          if (mimeType == null) {
              mimeType = defaultMimeType;
              if (mimeType == null) {
                  // no default MIME type was provided
                  return null;
              }
          }
          StringBuffer result = new StringBuffer(mimeType);
          if ((encoding != null)
              && (mimeType.startsWith("text") || mimeType.endsWith("javascript"))
              && (mimeType.indexOf("charset") == -1)) {
              result.append("; charset=");
              result.append(encoding);
          }
          return result.toString();
      }