/** * Initiate. * * @param isRequireSecure * Indicates if a secure {@link ServerHttpConnection} is required. * @param contentType * Content-type for the {@link ParsedTemplate}. May be * <code>null</code>. * @param charset * {@link Charset} for {@link ParsedTemplate}. * @param inputPath * {@link HttpInputPath} for the {@link WebTemplate}. * @param terminatingPathCharacter * {@link Character} to use to terminate the path. */ public WebTemplateInitialFunction(boolean isRequireSecure, String contentType, Charset charset, HttpInputPath inputPath, int terminatingPathCharacter) { this.isRequireSecure = isRequireSecure; this.contentType = contentType == null ? new HttpHeaderValue("text/html") : new HttpHeaderValue(contentType); this.charset = charset; this.inputPath = inputPath; this.terminatingPathCharacter = terminatingPathCharacter; }
@Override public String getContentType() { return contentType.getValue(); }
/** * Instantiate. * * @param allowedMethods * Allowed {@link HttpMethod} names. * @param handlers * {@link LeafWebRouteHandling} instances by their * {@link HttpMethod}. */ public LeafWebRouteNode(String[] allowedMethods, Map<HttpMethodEnum, LeafWebRouteHandling> handlers) { this.handlers = handlers; // Create the allow value StringBuilder value = new StringBuilder(); boolean isFirst = true; for (String allowedMethod : allowedMethods) { if (!isFirst) { value.append(", "); } isFirst = false; value.append(allowedMethod); } this.allowedMethods = new HttpHeaderValue(value.toString()); }
@Override public String getContentType() { return contentType.getValue(); }
new WritableHttpHeader(new HttpHeaderName("accept"), new HttpHeaderValue(accept.toString())) };
@Override public String getContentType() { return contentType.getValue(); }