/**
  * Returns the content type of a request (without an optional encoding).
  *
  * @return content type
  */
 public String contentType() {
   final String ct = req.getContentType();
   return ct != null ? ct.replaceFirst(";.*", "") : null;
 }
Beispiel #2
0
 /**
  * Request content type.
  *
  * @return the content type of the current request
  */
 private ContentType getRequestContentType() {
   final String s = req.getContentType();
   if (s == null) return null;
   if (s.contains(Response.MULTIPART)) return ContentType.MULTIPART;
   return TYPE_CONTENTS.get(s);
 }