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

org.tkit.quarkus.rs.context.RestContextHeaderContainer Maven / Gradle / Ivy

There is a newer version: 2.36.0
Show newest version
package org.tkit.quarkus.rs.context;

import jakarta.enterprise.context.RequestScoped;
import jakarta.ws.rs.container.ContainerRequestContext;
import jakarta.ws.rs.core.MultivaluedHashMap;
import jakarta.ws.rs.core.MultivaluedMap;

import io.quarkus.arc.Unremovable;

@RequestScoped
@Unremovable
public class RestContextHeaderContainer {

    private static final MultivaluedHashMap EMPTY_MAP = new MultivaluedHashMap<>();
    private ContainerRequestContext requestContext;

    void setContainerRequestContext(ContainerRequestContext requestContext) {
        this.requestContext = requestContext;
    }

    public MultivaluedMap getHeaders() {
        if (requestContext == null) {
            return EMPTY_MAP;
        } else {
            return requestContext.getHeaders();
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy