public void setContentType(String contentType) {
   this.contentType = contentType;
   if (contentType != null) {
     int charsetIndex = contentType.toLowerCase().indexOf(CHARSET_PREFIX);
     if (charsetIndex != -1) {
       String encoding = contentType.substring(charsetIndex + CHARSET_PREFIX.length());
       this.characterEncoding = encoding;
     }
     updateContentTypeHeader();
   }
 }
 public void setCharacterEncoding(String characterEncoding) {
   this.characterEncoding = characterEncoding;
   updateContentTypeHeader();
 }