code: private String determineMimeType(File file){
          String mimeType = MIME_MAP.getContentType(file);
          // if mimeType detection failed, fall back to the default
          if (mimeType == null || mimeType.equalsIgnoreCase("")){
              mimeType = DEFAULT_MIMETYPE;
          }
          return mimeType;
      }
docs: Determines the mime type of a given file
  
  @param file for which the mime type needs to be detected
  @return the detected mime type