Package org.geotools.data.ows

Examples of org.geotools.data.ows.SimpleHttpClient


     *            the relative path under {@code test-data} for the file containing the
     *            WFS_Capabilities document.
     */
    public static <T extends WFSStrategy> T createTestProtocol(String capabilitiesFileName, T real)
            throws Exception {
        HTTPClient http = new SimpleHttpClient();
        return createTestProtocol(capabilitiesFileName, http, real);
    }
View Full Code Here


    private Map<QName, SimpleFeatureType> featureTypes = new HashMap<QName, SimpleFeatureType>();

    public IntegrationTestWFSClient(String baseDirectory, WFSConfig config)
            throws ServiceException, IOException {

        super(url(baseDirectory + "/GetCapabilities.xml"), new SimpleHttpClient(), config);

        this.baseDirectory = url(baseDirectory);
    }
View Full Code Here

                throw new IOException(
                        "Cannot define only one of USERNAME or PASSWORD, must define both or neither");
            }
        }

        final HTTPClient http = new SimpleHttpClient();// new MultithreadedHttpClient();
        // TODO: let HTTPClient be configured for gzip
        // http.setTryGzip(tryGZIP);
        http.setUser(config.getUser());
        http.setPassword(config.getPassword());
        int timeoutMillis = config.getTimeoutMillis();
        http.setConnectTimeout(timeoutMillis / 1000);

        final URL capabilitiesURL = (URL) URL.lookUp(params);

        // WFSClient performs version negotiation and selects the correct strategy
        WFSClient wfsClient;
View Full Code Here

     *            the relative path under {@code test-data} for the file containing the
     *            WFS_Capabilities document.
     * @throws IOException
     */
    public static void createTestProtocol(String capabilitiesFileName) throws IOException {
        HTTPClient http = new SimpleHttpClient();
        createTestProtocol(capabilitiesFileName, http);
    }
View Full Code Here

        HTTPClient http = new SimpleHttpClient();
        createTestProtocol(capabilitiesFileName, http);
    }

    public static void createTestProtocol(String capabilitiesFileName, WFSStrategy strategy) throws IOException {
        HTTPClient http = new SimpleHttpClient();
        createTestProtocol(capabilitiesFileName, http, strategy);
    }
View Full Code Here

        } catch (IOException e) {
            assertTrue(true);
        }
        try {
            InputStream badData = new ByteArrayInputStream(new byte[1024]);
            HTTPClient connFac = new SimpleHttpClient();
            new WFS_1_1_0_Protocol(badData, connFac, null, null);
            fail("Excpected IOException as a capabilities document was not provided");
        } catch (IOException e) {
            assertTrue(true);
        }
View Full Code Here

     *            the relative path under {@code test-data} for the file containing the
     *            WFS_Capabilities document.
     * @throws IOException
     */
    public static void createTestProtocol(String capabilitiesFileName) throws IOException, ServiceException {
        createTestProtocol(capabilitiesFileName, new SimpleHttpClient());
    }
View Full Code Here

        return client;
    }

    private WFSClient newClient(String resource) throws IOException, ServiceException {
        URL capabilitiesURL = WFSTestData.url(resource);
        HTTPClient httpClient = new SimpleHttpClient();

        WFSClient client = new WFSClient(capabilitiesURL, httpClient, config);
        return client;
    }
View Full Code Here

    }

    private HTTPClient getHttpClient() {
        if (httpClient == null) {
            httpClient = new SimpleHttpClient();
        }
        return httpClient;
    }
View Full Code Here

                int maxConnections = info.getMaxConnections();
                MultithreadedHttpClient mtClient = (MultithreadedHttpClient) client;
                mtClient.setMaxConnections(maxConnections);
            }
        } else {
            client = new SimpleHttpClient();
        }
        String username = info.getUsername();
        String password = info.getPassword();
        int connectTimeout = info.getConnectTimeout();
        int readTimeout = info.getReadTimeout();
View Full Code Here

TOP

Related Classes of org.geotools.data.ows.SimpleHttpClient

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.