public String toString(ParameterList parameters) { StringBuffer sbuf = new StringBuffer(fragments[0]); for (int i = 1; i < fragments.length; ++i) { if (parameters == null) sbuf.append("?"); else sbuf.append(parameters.toString(i)); sbuf.append(fragments[i]); } return sbuf.toString(); }
/** * Retrieve a RFC2045 style string representation of this Content-Type. Returns <code>null</code> * if the conversion failed. * * @return RFC2045 style string */ public String toString() { if (primaryType == null || subType == null) // need both return null; StringBuffer sb = new StringBuffer(); sb.append(primaryType).append('/').append(subType); if (list != null) // Http Binding section of the "SOAP with attachments" specification says, // "SOAP message senders should send Content-Type headers on a single long line." // (http://www.w3.org/TR/SOAP-attachments#HTTPBinding) sb.append(list.toString()); return sb.toString(); }