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

com.fireflysource.net.http.client.HttpClientContentHandlerFactory Maven / Gradle / Ivy

There is a newer version: 5.0.2
Show newest version
package com.fireflysource.net.http.client;

import com.fireflysource.net.http.client.impl.content.handler.ByteBufferContentHandler;
import com.fireflysource.net.http.client.impl.content.handler.FileContentHandler;
import com.fireflysource.net.http.client.impl.content.handler.StringContentHandler;

import java.nio.file.OpenOption;
import java.nio.file.Path;

abstract public class HttpClientContentHandlerFactory {

    public static HttpClientContentHandler bytesHandler() {
        return new ByteBufferContentHandler();
    }

    public static HttpClientContentHandler bytesHandler(long maxRequestBodySize) {
        return new ByteBufferContentHandler(maxRequestBodySize);
    }

    public static HttpClientContentHandler stringHandler() {
        return new StringContentHandler();
    }

    public static HttpClientContentHandler stringHandler(long maxRequestBodySize) {
        return new StringContentHandler(maxRequestBodySize);
    }

    public static HttpClientContentHandler fileHandler(Path path, OpenOption... openOptions) {
        return new FileContentHandler(path, openOptions);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy