All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jn.agileway.jaxrs.rr.JaxrsHttpResponse Maven / Gradle / Ivy

There is a newer version: 5.0.4
Show newest version
package com.jn.agileway.jaxrs.rr;

import com.jn.agileway.http.rr.HttpResponse;

import javax.ws.rs.container.ContainerResponseContext;
import java.util.Collection;

public class JaxrsHttpResponse implements HttpResponse {
    private ContainerResponseContext containerResponse;

    public JaxrsHttpResponse(ContainerResponseContext context) {
        this.containerResponse = context;
    }

    public ContainerResponseContext getContainerResponse() {
        return this.containerResponse;
    }

    @Override
    public void addHeader(String name, String value) {
        // unsupported
    }

    @Override
    public String getHeader(String name) {
        return this.containerResponse.getHeaderString(name);
    }

    @Override
    public Collection getHeaderNames() {
        return this.containerResponse.getHeaders().keySet();
    }

    @Override
    public Collection getHeaders(String name) {
        return this.containerResponse.getStringHeaders().get(name);
    }

    @Override
    public int getStatusCode() {
        return this.containerResponse.getStatus();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy