Search in sources :

Example 1 with MultipartFormDataWriter

use of org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataWriter in project syndesis-qe by syndesisio.

the class EndpointClient method getClient.

public static Client getClient(ResteasyJackson2Provider jackson2Provider) {
    final ApacheHttpClient43Engine engine = new ApacheHttpClient43Engine(createAllTrustingClient());
    final ResteasyProviderFactory providerFactory = new LocalResteasyProviderFactory();
    providerFactory.register(jackson2Provider).register(// needed for GET application/octet-stream in PublicAPI to export zip
    new InputStreamProvider()).register(// needed to POST mutipart form data (necessary for API provider + PublicAPI)
    new MultipartFormDataWriter()).register(// needed to serialize text/plain (again for API provider)
    new StringTextStar()).register(new ErrorLogger());
    ResteasyClientBuilder clientBuilder = (ResteasyClientBuilder) ResteasyClientBuilder.newBuilder();
    clientBuilder.providerFactory(providerFactory);
    clientBuilder.httpEngine(engine);
    return clientBuilder.build();
}
Also used : MultipartFormDataWriter(org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataWriter) ResteasyClientBuilder(org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder) InputStreamProvider(org.jboss.resteasy.plugins.providers.InputStreamProvider) ResteasyProviderFactory(org.jboss.resteasy.spi.ResteasyProviderFactory) LocalResteasyProviderFactory(org.jboss.resteasy.client.jaxrs.internal.LocalResteasyProviderFactory) LocalResteasyProviderFactory(org.jboss.resteasy.client.jaxrs.internal.LocalResteasyProviderFactory) ApacheHttpClient43Engine(org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient43Engine) StringTextStar(org.jboss.resteasy.plugins.providers.StringTextStar)

Aggregations

ResteasyClientBuilder (org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder)1 ApacheHttpClient43Engine (org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient43Engine)1 LocalResteasyProviderFactory (org.jboss.resteasy.client.jaxrs.internal.LocalResteasyProviderFactory)1 InputStreamProvider (org.jboss.resteasy.plugins.providers.InputStreamProvider)1 StringTextStar (org.jboss.resteasy.plugins.providers.StringTextStar)1 MultipartFormDataWriter (org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataWriter)1 ResteasyProviderFactory (org.jboss.resteasy.spi.ResteasyProviderFactory)1