Package org.apache.http

Examples of org.apache.http.MethodNotSupportedException


        protected void doService(final HttpRequest request, final HttpResponse response)
                throws HttpException, IOException {
            String method = request.getRequestLine().getMethod();
            if (!method.equalsIgnoreCase("GET") && !method.equalsIgnoreCase("HEAD")) {
                throw new MethodNotSupportedException(method + " method not supported");
            }
            String docroot = (String) request.getParams().getParameter("server.docroot");
            String target = request.getRequestLine().getUri();
            File file = new File(docroot, URLDecoder.decode(target));
            if (!file.exists()) {
View Full Code Here


                       final HttpContext context)
        throws HttpException, IOException {

        String method = request.getRequestLine().getMethod().toUpperCase();
        if (!"GET".equals(method) && !"HEAD".equals(method)) {
            throw new MethodNotSupportedException
                (method + " not supported by " + getClass().getName());
        }

        String uri = request.getRequestLine().getUri();
        int  slash = uri.lastIndexOf('/');
View Full Code Here

        String method = request.getRequestLine().getMethod().toUpperCase();
        if (!"GET".equals(method) &&
            !"POST".equals(method) &&
            !"PUT".equals(method)
            ) {
            throw new MethodNotSupportedException
                (method + " not supported by " + getClass().getName());
        }

        HttpEntity entity = null;
        if (request instanceof HttpEntityEnclosingRequest)
View Full Code Here

                    msgContext,
                    response.getOutputStream(),
                    null);

        } else {
            throw new MethodNotSupportedException(method + " method not supported");
        }
       
        Boolean holdResponse =
            (Boolean) msgContext.getProperty(RequestResponseTransport.HOLD_RESPONSE);
        if (pi.equals(InvocationResponse.SUSPEND) ||
View Full Code Here

            final String method = request.getRequestLine().getMethod().toUpperCase(Locale.ENGLISH);
            if (!"GET".equals(method) &&
                    !"POST".equals(method) &&
                    !"PUT".equals(method)
                    ) {
                throw new MethodNotSupportedException
                        (method + " not supported by " + getClass().getName());
            }

            response.setStatusCode(org.apache.http.HttpStatus.SC_OK);
            response.addHeader("Cache-Control",getCacheContent(request));
View Full Code Here

                    msgContext,
                    response.getOutputStream(),
                    null);

        } else {
            throw new MethodNotSupportedException(method + " method not supported");
        }
       
        Boolean holdResponse =
            (Boolean) msgContext.getProperty(RequestResponseTransport.HOLD_RESPONSE);
        if (pi.equals(InvocationResponse.SUSPEND) ||
View Full Code Here

        } else if (isOneOf(RFC2616_ENTITY_ENC_METHODS, method)) {
            return new BasicHttpEntityEnclosingRequest(requestline);
        } else if (isOneOf(RFC2616_SPECIAL_METHODS, method)) {
            return new BasicHttpRequest(requestline);
        } else {
            throw new MethodNotSupportedException(method +  " method not supported");
        }
    }
View Full Code Here

        } else if (isOneOf(RFC2616_ENTITY_ENC_METHODS, method)) {
            return new BasicHttpEntityEnclosingRequest(method, uri);
        } else if (isOneOf(RFC2616_SPECIAL_METHODS, method)) {
            return new BasicHttpRequest(method, uri);
        } else {
            throw new MethodNotSupportedException(method
                    + " method not supported");
        }
    }
View Full Code Here

                final HttpResponse response,
                final HttpContext context) throws HttpException, IOException {

            String method = request.getRequestLine().getMethod().toUpperCase(Locale.ENGLISH);
            if (!method.equals("GET") && !method.equals("HEAD") && !method.equals("POST")) {
                throw new MethodNotSupportedException(method + " method not supported");
            }
            String target = request.getRequestLine().getUri();

            if (request instanceof HttpEntityEnclosingRequest) {
                HttpEntity entity = ((HttpEntityEnclosingRequest) request).getEntity();
View Full Code Here

                    msgContext,
                    response.getOutputStream(),
                    null);

        } else {
            throw new MethodNotSupportedException(method + " method not supported");
        }
       
        Boolean holdResponse =
            (Boolean) msgContext.getProperty(RequestResponseTransport.HOLD_RESPONSE);
        if (pi.equals(InvocationResponse.SUSPEND) ||
View Full Code Here

TOP

Related Classes of org.apache.http.MethodNotSupportedException

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.