Package com.btaz.util.api.rest

Examples of com.btaz.util.api.rest.RestApiException


            this.method = method;
        }

        // host
        if(host == null) {
            throw new RestApiException("Invalid hostname");
        }
        this.host = host;

        // port
        this.port = port;
View Full Code Here


     */
    public Resource(String url) throws RestApiException {
        // match URL
        Matcher m = reResource.matcher(url);
        if(! m.matches()) {
            throw new RestApiException("Invalid URL pattern: " + url);
        }

        // method
        if(m.group(1) != null) {
            method = Method.valueOf(m.group(1).toUpperCase());
        } else {
            method = Method.HTTP;
        }

        // host
        if(m.group(2) == null) {
            throw new RestApiException("Invalid host definition");
        }
        host = m.group(2);

        // port
        if(m.group(3) != null) {
View Full Code Here

TOP

Related Classes of com.btaz.util.api.rest.RestApiException

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.