예제 #1
0
 /**
  * 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;
 }
예제 #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);
 }