Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package restx.server.simple.simple;
 
 
User: xavierhanin Date: 2/16/13 Time: 1:57 PM
public class SimpleRestxResponse extends AbstractResponse<Response> {
    private final Response response;
    public SimpleRestxResponse(Response response) {
        super(Response.classresponse);
        this. = response;
    }
    @Override
    public RestxResponse addCookie(String cookieString valueDuration expiration) {
        Cookie c = new Cookie(cookievalue"/");
        c.setExpiry(expiration.getStandardSeconds() > 0 ? (intexpiration.getStandardSeconds() : -1);
        .setCookie(c);
        return this;
    }
    @Override
    public RestxResponse clearCookie(String cookie) {
        Cookie c = new Cookie(cookie"");
        c.setPath("/");
        c.setExpiry(0);
        .setCookie(c);
        return this;
    }
    @Override
    public void doSetHeader(String headerNameString header) {
        .setValue(headerNameheader);
    }
    @Override
    protected void closeResponse() throws IOException {
        .close();
    }
    @Override
    protected OutputStream doGetOutputStream() throws IOException {
        return .getOutputStream();
    }
    @Override
    protected void doSetStatus(HttpStatus httpStatus) {
        .setCode(httpStatus.getCode());
    }
New to GrepCode? Check out our FAQ X