Package org.restlet.data

Examples of org.restlet.data.Warning


        super(header);
    }

    @Override
    public Warning readValue() throws IOException {
        Warning result = new Warning();

        String code = readToken();
        skipSpaces();
        String agent = readRawText();
        skipSpaces();
        String text = readQuotedString();
        // The date is not mandatory
        skipSpaces();
        String date = null;
        if (peek() != -1) {
            date = readQuotedString();
        }

        if ((code == null) || (agent == null) || (text == null)) {
            throw new IOException("Warning header malformed.");
        }

        result.setStatus(Status.valueOf(Integer.parseInt(code)));
        result.setAgent(agent);
        result.setText(text);
        if (date != null) {
            result.setDate(DateUtils.parse(date));
        }

        return result;
    }
View Full Code Here

TOP

Related Classes of org.restlet.data.Warning

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.