/*
(non-Javadoc)
@see javax.servlet.sip.SipServletMessage#setContent(java.lang.Object, java.lang.String)
196748
public void setContent(Object content, String contentType)
			throws UnsupportedEncodingException {
		// https://code.google.com/p/sipservlets/issues/detail?id=202
		if(getSipSession().getProxy() == null) {
			checkMessageState();
		}
		checkContentType(contentType);
		checkCommitted();

		if(contentType != null && contentType.length() > 0) {
			this.addHeader(ContentTypeHeader.NAME, contentType);
			ContentTypeHeader contentTypeHeader = (ContentTypeHeader)this.message.getHeader(ContentTypeHeader.NAME);
			String charset = this.getCharacterEncoding();
			try {
			    // https://code.google.com/p/sipservlets/issues/detail?id=169
				if(contentType.contains(CONTENT_TYPE_MULTIPART) && content instanceof Multipart) {
					// Fix for Issue 2667 : Correct Handling of MimeMultipart
					Multipart multipart = (Multipart) content;
					OutputStream os = new ByteArrayOutputStream();
					multipart.writeTo(os);
					this.message.setContent(os.toString(), contentTypeHeader);
				} else {
					Object tmpContent = content;
					if(tmpContent instanceof String  && charset != null) {
						//test for unsupportedencoding exception
						new String("testEncoding".getBytes(charset));
						tmpContent = new String(((String)tmpContent).getBytes());
					}
					this.message.setContent(content, contentTypeHeader);
				}
			} catch (UnsupportedEncodingException uee) {
				throw uee;
			} catch (Exception e) {
				throw new IllegalArgumentException("Parse error reading content " + content + " with content type " + contentType, e);
			}
		}
	}
271791
public static void setContent (JInternalDialog dialog, JPanel content)
    {
        Container holder = dialog.getContentPane();
        holder.removeAll();
        holder.add(content, BorderLayout.CENTER);
        dialog.pack();
    }
930266
public void setContent(IContent content)
	{
		this.content = content;
		content.setParent(this);
		content.setPosition(Position.middleCenter(content));
		contentSize = content.size().plus(Size.of(6, 6));
	}
296064
@JsonIgnore
    public void encodeAndSetContent(byte[] byteContent) {

        if (byteContent == null) {
            this.content = null;
            return;
        }

        this.content = Base64.getEncoder().encodeToString(byteContent);
        encoding = "base64";
    }
708375
public void setContent(java.util.Collection<java.util.Map<String, String>> content) {
        if (content == null) {
            this.content = null;
            return;
        }

        this.content = new com.amazonaws.internal.SdkInternalList<java.util.Map<String, String>>(content);
    }
1280081
public void setContent(final String content) {
        if (content != null)
            attrMixin.setAttribute(CONTENT, content);
        else
            attrMixin.removeAttribute(CONTENT);
    }
767841
public void setContentType(String contentType) throws InvalidArgumentException {
    if (Strings.isNullOrEmpty(contentType)) {
      throw new InvalidArgumentException("empty content type");
    }

    this.contentType = contentType;
  }
765015
@Nonnull
  public final UnifiedResponse setContentAndCharset (@Nonnull final String sContent, @Nonnull final Charset aCharset)
  {
    ValueEnforcer.notNull (sContent, "Content");
    setCharset (aCharset);
    setContent (sContent.getBytes (aCharset));
    return this;
  }
1341434
public void setContents(Contents contents) {
		this.contents = contents;
		if (contents != null) {
			this.tableName = contents.getId();
		} else {
			this.tableName = null;
		}
	}
26268
public void setContentLength(long len)
    {
        if (TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {  //306998.15
            logger.logp(Level.FINE, CLASS_NAME,"setContentLength", "setContentLength --> "+len);
        } 
        if ( len < 0 )
        {
            logger.logp(Level.SEVERE, CLASS_NAME,"setContentLength", "Illegal.Argument.Invalid.Content.Length");
            throw new IllegalArgumentException(nls.getString("Illegal.Argument.Invalid.Content.Length","Illegal Argument: Invalid Content Length"));
        }
        length = len;
        if ( Long.MAX_VALUE - total > len )   // PK79219
        {
            limit = total + len;
        }
    }
331933
public void setContentAge(long contentAge) {

        if (contentAge < 0) {
            String ageString = Long.toString(contentAge);
            throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_BAD_CONTENT_AGE_1, ageString));
        }
        m_contentAge = contentAge;
    }
250424
public void setContentPane(Container contentPanel) {
        if (contentPanel == null) {
            throw new IllegalArgumentException("Content pane can't be null");
        }

        if (wrapper != null) {
            super.remove(wrapper);
        }
        wrapper = new WrapperContainer(contentPanel);
        super.addImpl(wrapper, BorderLayout.CENTER, -1);
    }
1006871
@Nonnull
  public final UnifiedResponse setContent (@Nonnull final IHasInputStream aISP)
  {
    ValueEnforcer.notNull (aISP, "InputStreamProvider");
    if (hasContent ())
      logInfo ("Overwriting content with content provider!");
    m_aContentArray = null;
    m_nContentArrayOfs = -1;
    m_nContentArrayLength = -1;
    m_aContentISP = aISP;
    return this;
  }
24914
public ServiceResult<T> setContent(T serviceResultContent) {
        content = serviceResultContent;
        setHash(ObjectHasher.hash(content));
        return this;
    }
1223782
public void setContents(ArrayList contents) {
		this.contents = contents;
		containsMarkupText = false;
		containsSingleString = false;
		Iterator i = contents.iterator();

		while (i.hasNext()) {
			Object o = i.next();
			if (!(o instanceof Node)) {
				if (o instanceof String && o.toString().trim().length() > 0) {
					if (contents.size() == 1) {
						containsSingleString = true;
					} else {
						containsSingleString = false;
						containsMarkupText = true;
					}
				}
			} else {
				Node node = (Node) o;
//				node.setDepth(depth + 1);
				node.parentNode = this instanceof Node ? (Node) this : null;
			}
		}
	}
1107288
public void setContent(Content content) {
        setSize(content.getContent().length);
        setAttachmentContentId(content.getId());
    }
1247286
public final void setContent(ContentPart<?>[] content)
    {
        //clear non relevant flags
        this.contentString=null;
        this.contentBinary=null;
        this.contentType=ContentType.MULTI_PART;

        if(content==null)
        {
            this.contentParts=null;
        }
        else
        {
            this.contentParts=content.clone();
        }
    }