All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.king.platform.net.http.netty.requestbuilder.MultiPartHttpBodyBuilder Maven / Gradle / Ivy

There is a newer version: 3.0.26
Show newest version
package com.king.platform.net.http.netty.requestbuilder;


import com.king.platform.net.http.BuiltMultiPart;
import com.king.platform.net.http.netty.request.HttpBody;
import com.king.platform.net.http.netty.request.multipart.MultiPartHttpBody;

import java.nio.charset.Charset;

public class MultiPartHttpBodyBuilder implements RequestBodyBuilder {
	private final BuiltMultiPart builtMultiPart;

	public MultiPartHttpBodyBuilder(BuiltMultiPart builtMultiPart) {
		this.builtMultiPart = builtMultiPart;
	}

	@Override
	public HttpBody createHttpBody(String contentType, Charset characterEncoding) {
		if (contentType == null) {
			contentType = "multipart/form-data";
		}
		return new MultiPartHttpBody(builtMultiPart.getParts(), contentType, builtMultiPart.getBoundary());
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy