public RequestImpl(final Injector injector, final NativeRequest req, final String contextPath, final int port, final Route route, final Charset charset, final List<Locale> locales, final Map<Object, Object> scope, final Map<String, Object> locals, final long timestamp) { this.injector = injector; this.req = req; this.route = route; this.scope = scope; this.locals = locals; this.contextPath = contextPath; Optional<String> accept = req.header("Accept"); this.accept = accept.isPresent() ? MediaType.parse(accept.get()) : MediaType.ALL; this.lang = req.header("Accept-Language"); this.locales = locales; this.port = port; Optional<String> type = req.header("Content-Type"); this.type = type.isPresent() ? MediaType.valueOf(type.get()) : MediaType.all; String cs = this.type.params().get("charset"); this.charset = cs != null ? Charset.forName(cs) : charset; this.files = new ArrayList<>(); this.timestamp = timestamp; }
public RequestImpl(final Injector injector, final NativeRequest req, final String contextPath, final int port, final Route route, final Charset charset, final List<Locale> locales, final Map<Object, Object> scope, final Map<String, Object> locals, final long timestamp) { this.injector = injector; this.req = req; this.route = route; this.scope = scope; this.locals = locals; this.contextPath = contextPath; Optional<String> accept = req.header("Accept"); this.accept = accept.isPresent() ? MediaType.parse(accept.get()) : MediaType.ALL; this.lang = req.header("Accept-Language"); this.locales = locales; this.port = port; Optional<String> type = req.header("Content-Type"); this.type = type.isPresent() ? MediaType.valueOf(type.get()) : MediaType.all; String cs = this.type.params().get("charset"); this.charset = cs != null ? Charset.forName(cs) : charset; this.files = new ArrayList<>(); this.timestamp = timestamp; }