/** * Creates an instance using the specified parameters * @param mode the mode to use, may be {@code null}, in which case {@link HttpMultipartMode#STRICT} is used * @param boundary the boundary string, may be {@code null}, in which case {@link #generateBoundary()} is invoked to create the string * @param charset the character set to use, may be {@code null}, in which case {@link MIME#DEFAULT_CHARSET} - i.e. US-ASCII - is used. */ public MultipartEntity( HttpMultipartMode mode, String boundary, Charset charset) { super(); if (boundary == null) { boundary = generateBoundary(); } if (mode == null) { mode = HttpMultipartMode.STRICT; } this.multipart = new HttpMultipart("form-data", charset, boundary, mode); this.contentType = new BasicHeader( HTTP.CONTENT_TYPE, generateContentType(boundary, charset)); this.dirty = true; }