Tabnine Logo
NettyMultipartBody.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
com.ning.http.client.providers.netty.request.body.NettyMultipartBody
constructor

Best Java code snippets using com.ning.http.client.providers.netty.request.body.NettyMultipartBody.<init> (Showing top 2 results out of 315)

origin: com.ning/async-http-client

nettyBody = new NettyMultipartBody(request.getParts(), request.getHeaders(), nettyConfig);
origin: io.gatling/async-http-client

private NettyBody body(Request request, HttpMethod method) throws IOException {
  NettyBody nettyBody = null;
  if (method != HttpMethod.CONNECT) {
    Charset bodyCharset = request.getBodyEncoding() == null ? DEFAULT_CHARSET : Charset.forName(request.getBodyEncoding());
    if (request.getByteData() != null)
      nettyBody = new NettyByteArrayBody(request.getByteData());
    else if (request.getStringData() != null)
      nettyBody = new NettyByteArrayBody(request.getStringData().getBytes(bodyCharset));
    else if (request.getStreamData() != null)
      nettyBody = new NettyInputStreamBody(request.getStreamData());
    else if (isNonEmpty(request.getFormParams())) {
      String contentType = null;
      if (!request.getHeaders().containsKey(HttpHeaders.Names.CONTENT_TYPE))
        contentType = HttpHeaders.Values.APPLICATION_X_WWW_FORM_URLENCODED;
      nettyBody = new NettyByteArrayBody(computeBodyFromParams(request.getFormParams(), bodyCharset), contentType);
    } else if (isNonEmpty(request.getParts()))
      nettyBody = new NettyMultipartBody(request.getParts(), request.getHeaders(), nettyConfig);
    else if (request.getFile() != null)
      nettyBody = new NettyFileBody(request.getFile(), nettyConfig);
    else if (request.getBodyGenerator() instanceof FileBodyGenerator) {
      FileBodyGenerator fileBodyGenerator = (FileBodyGenerator) request.getBodyGenerator();
      nettyBody = new NettyFileBody(fileBodyGenerator.getFile(), fileBodyGenerator.getRegionSeek(),
          fileBodyGenerator.getRegionLength(), nettyConfig);
    } else if (request.getBodyGenerator() instanceof InputStreamBodyGenerator)
      nettyBody = new NettyInputStreamBody(InputStreamBodyGenerator.class.cast(request.getBodyGenerator()).getInputStream());
    else if (request.getBodyGenerator() != null)
      nettyBody = new NettyBodyBody(request.getBodyGenerator().createBody(), nettyConfig);
  }
  return nettyBody;
}
com.ning.http.client.providers.netty.request.bodyNettyMultipartBody<init>

Popular methods of NettyMultipartBody

    Popular in Java

    • Creating JSON documents from java classes using gson
    • getSupportFragmentManager (FragmentActivity)
    • getResourceAsStream (ClassLoader)
    • getOriginalFilename (MultipartFile)
      Return the original filename in the client's filesystem.This may contain path information depending
    • Charset (java.nio.charset)
      A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
    • MessageDigest (java.security)
      Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
    • Map (java.util)
      A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
    • UUID (java.util)
      UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
    • CountDownLatch (java.util.concurrent)
      A synchronization aid that allows one or more threads to wait until a set of operations being perfor
    • Table (org.hibernate.mapping)
      A relational table
    • Best plugins for Eclipse
    Tabnine Logo
    • Products

      Search for Java codeSearch for JavaScript code
    • IDE Plugins

      IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
    • Company

      About UsContact UsCareers
    • Resources

      FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
    Get Tabnine for your IDE now