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

templates.qeex.LanguageInterceptor.ftl Maven / Gradle / Ivy

There is a newer version: 3.0.3
Show newest version
package ${groupId}.api.qeex.interceptors;

import jakarta.enterprise.context.ApplicationScoped;
import jakarta.ws.rs.container.ContainerRequestContext;
import jakarta.ws.rs.container.ContainerRequestFilter;
import jakarta.ws.rs.ext.Provider;
import java.io.IOException;

@Provider
@ApplicationScoped
public class LanguageInterceptor implements ContainerRequestFilter {

    private String language;


    public String getLanguage() {
        return language;
    }

    @Override
    public void filter(ContainerRequestContext context) throws IOException {
        if (context.getHeaders().containsKey("language")) {
            var language = context.getHeaders().getFirst("language");
            this.language = language;
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy