Package org.geotools.data.ows

Examples of org.geotools.data.ows.HTTPResponse


                }
                return true;
            }
            InputStream inputStream = null;
            try {
                HTTPResponse response = issueRequest(request);
                String cacheControl = extractHeaderCacheControl(response);
                setMaxCacheAge(cacheControl);
                inputStream = response.getResponseStream();
                // simulate latency if testing
                if (testing) {
                    Random rand = new Random();
                    long delay = rand.nextInt(5000); // delay 1-5 secs
                    System.out.println("request delaying for: " + delay); //$NON-NLS-1$
View Full Code Here


            // System.out.prinln("Poor WMS-C configuration - no host provided by "+ finalURL );
            throw new NullPointerException("No host provided by " + finalURL); //$NON-NLS-1$
        }

        final HTTPClient httpClient = server.getHTTPClient();
        final HTTPResponse httpResponse;

        if (request.requiresPost()) {

            final String postContentType = request.getPostContentType();
View Full Code Here

        WMSCCapabilities capabilities = null;
        try {
            final InputStream is = new ByteArrayInputStream(caps_xml.getBytes());
            WMSCCapabilitiesResponse response;

            HTTPResponse mock = new HTTPResponse(){

                @Override
                public InputStream getResponseStream() throws IOException {
                    return is;
                }
View Full Code Here

        && (request.getProperties().get(GetFeatureInfoRequest.QUERY_Y).equals("200"))) {
        String success = "SUCCESS";
       
        ByteArrayInputStream input = new ByteArrayInputStream(success.getBytes());
       
        HTTPResponse response = new MockHttpResponse( input, "text/html");
        return new GetFeatureInfoResponse( response );
      }
     
      String failure = "FAILURE";
     
      ByteArrayInputStream input = new ByteArrayInputStream(failure.getBytes());
      HTTPResponse response = new MockHttpResponse( input, "text/html");
     
      return new GetFeatureInfoResponse( response );
    }
View Full Code Here

        return (ExecuteProcessResponse) internalIssueRequest(request);
    }
   
    public ExecuteProcessResponse issueStatusRequest(URL statusURL) throws IOException, ServiceException
    {
        final HTTPResponse httpResponse;

        httpResponse = httpClient.get(statusURL);

        // a request with status can never use raw requests
        return new ExecuteProcessResponse(httpResponse, false);
View Full Code Here

        throw new IllegalArgumentException("Unknown request : " + request);
    }

    private Response mockCapabilities() throws IOException, ServiceException {
        HTTPResponse httpResp = new TestHttpResponse("text/xml", "UTF-8", super.serverURL);

        return new GetCapabilitiesResponse(httpResp);
    }
View Full Code Here

        String resource = "DescribeFeatureType_" + typeName.getLocalPart() + ".xsd";
        URL contentUrl = new URL(baseDirectory, resource);

        String outputFormat = request.getOutputFormat();

        HTTPResponse response = new TestHttpResponse(outputFormat, "UTF-8", contentUrl);
        DescribeFeatureTypeResponse ret = new DescribeFeatureTypeResponse(request, response);
        FeatureType featureType = ret.getFeatureType();
        this.featureTypes.put(typeName, (SimpleFeatureType) featureType);
        return ret;
    }
View Full Code Here

        String resource = "GetFeature_" + typeName.getLocalPart() + ".xml";
        URL contentUrl = new URL(baseDirectory, resource);

        String outputFormat = request.getOutputFormat();

        HTTPResponse httpResponse = new TestHttpResponse(outputFormat, "UTF-8", contentUrl);

        WFSResponse response = request.createResponse(httpResponse);

        if (!(response instanceof GetFeatureResponse)) {
            return response;
View Full Code Here

        }

        String outputFormat = request.getOutputFormat();
        String responseContents = createTransactionResponseXml(added, updated, deleted);
        HTTPResponse httpResponse = new TestHttpResponse(outputFormat, "UTF-8", responseContents);
       
        return request.createResponse(httpResponse);
    }
View Full Code Here

     * @throws IOException
     */
    byte[] loadCapabilities(final URL capabilitiesUrl, HTTPClient http) throws IOException {
        byte[] wfsCapabilitiesRawData;

        HTTPResponse httpResponse = http.get(capabilitiesUrl);
        InputStream inputStream = httpResponse.getResponseStream();

        ByteArrayOutputStream out = new ByteArrayOutputStream();
        byte[] buff = new byte[1024];
        int readCount;
        while ((readCount = inputStream.read(buff)) != -1) {
View Full Code Here

TOP

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

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.