Package com.sun.jersey.api.client.config

Examples of com.sun.jersey.api.client.config.ClientConfig


    protected void setUp() throws Exception {
        super.setUp();

        startServer(MultiPartResource.class, MultiPartBeanProvider.class);

        ClientConfig config = new DefaultClientConfig();
        config.getClasses().add(MultiPartBeanProvider.class);
        client = Client.create(config);
    }
View Full Code Here


            .name("test")
            .payload("From Test")
            .serviceType(ServiceType.STATIC)
            .build();

        ClientConfig    config = new DefaultClientConfig()
        {
            @Override
            public Set<Object> getSingletons()
            {
                Set<Object>     singletons = Sets.newHashSet();
View Full Code Here

    }

    @Test
    public void     testEmptyServiceNames()
    {
        ClientConfig    config = new DefaultClientConfig()
        {
            @Override
            public Set<Object> getSingletons()
            {
                Set<Object>     singletons = Sets.newHashSet();
View Full Code Here

            .name("test")
            .payload(payload)
            .serviceType(ServiceType.STATIC)
            .build();

        ClientConfig    config = new DefaultClientConfig()
        {
            @Override
            public Set<Object> getSingletons()
            {
                Set<Object>     singletons = Sets.newHashSet();
View Full Code Here

            .name("test")
            .payload(payload)
            .serviceType(ServiceType.STATIC)
            .build();

        ClientConfig    config = new DefaultClientConfig()
        {
            @Override
            public Set<Object> getSingletons()
            {
                Set<Object>     singletons = Sets.newHashSet();
View Full Code Here

     * @param url the URL to invoke in the request.
     * @param method the HTTP method.
     * @return the response.
     */
    public static String request(final String url, final HTTP_METHOD method) {
        ClientConfig clientConfig = new DefaultClientConfig();
        Client client = Client.create(clientConfig);

        WebResource webResource = client.resource(url);
        String response = null;
        switch (method) {
View Full Code Here

    }

    public void publish(File widget) {
        HTTPBasicAuthFilter authFilter = new HTTPBasicAuthFilter(WOOKIE_USER,WOOKIE_PASS);
       
        ClientConfig clientConfig = new DefaultClientConfig();
        Client client = Client.create(clientConfig);       
        client.addFilter(authFilter);
        client.addFilter(new LoggingFilter());
       
        WebResource webResource = client.resource(WOOKIE_URL);
View Full Code Here

    }
   
    public List<OMRService> searchServicesByQuery(String query) throws XmlException, IOException {
        HTTPBasicAuthFilter authFilter = new HTTPBasicAuthFilter(USER,PASS);
       
        ClientConfig clientConfig = new DefaultClientConfig();
        Client client = Client.create(clientConfig);       
        client.addFilter(authFilter);
       
        WebResource webResource = client.resource(OMR_SERVER_URL);
        String string = webResource.get(String.class);
View Full Code Here

     * Returns a client configuration with the proper settings/features for
     * communication with AppThwack.
     * @return fully created client configuration object.
     */
    private ClientConfig getClientConfig() {
        ClientConfig config = new DefaultClientConfig();
        config.getClasses().add(JacksonJaxbJsonProvider.class);
        config.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE);
        config.getProperties().put(ClientConfig.PROPERTY_FOLLOW_REDIRECTS, Boolean.TRUE);
        return config;
    }
View Full Code Here

public class JerseyUtil {
    public static Client createClient( AtmosConfig config,
                                       List<Class<MessageBodyReader<?>>> readers,
                                       List<Class<MessageBodyWriter<?>>> writers ) {
        try {
            ClientConfig clientConfig = new DefaultClientConfig();

            // register an open trust manager to allow SSL connections to servers with self-signed certificates
            if ( config.isDisableSslValidation() ) {
                clientConfig.getProperties().put( HTTPSProperties.PROPERTY_HTTPS_PROPERTIES,
                                                  new HTTPSProperties( SslUtil.gullibleVerifier,
                                                                       SslUtil.createGullibleSslContext() ) );
            }

            addHandlers( clientConfig, readers, writers );
View Full Code Here

TOP

Related Classes of com.sun.jersey.api.client.config.ClientConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.