code: public static String getMimeType(Resource resource, String defaultValue) {
          MimeType mimeType = getMimeType(resource);
          return mimeType != null ? mimeType.toString() : defaultValue;
      }
docs: Detects the mime type of a binary resource (nt:file, nt:resource or another asset type).
  
  @param resource     the binary resource
  @param defaultValue the default value if the detection has no useful result
  @return he detected mime type or the default value given