protected CDN(final String pattern) { this.resource = Path.matches(pattern); }
protected CDN(final String pattern) { this.resource = Path.matches(pattern); }
protected CDN(final String pattern) { this.resource = Path.matches(pattern); }
protected Join(final String pattern, boolean requestBinding) { this.requestPattern = pattern; this.requestPath = Path.matches(pattern); if (requestBinding) requestPath.withRequestBinding(); this.bindingEnabled = requestBinding; }
protected Join(final String pattern, boolean requestBinding) { this.requestPattern = pattern; this.requestPath = Path.matches(pattern); if (requestBinding) requestPath.withRequestBinding(); this.bindingEnabled = requestBinding; }
protected Join(final String pattern, boolean requestBinding) { this.requestPattern = pattern; this.requestPath = Path.matches(pattern); if (requestBinding) requestPath.withRequestBinding(); this.bindingEnabled = requestBinding; }
private Condition matchesAnyOfPaths(Set<String> paths) { Set<Path> pathSet = new HashSet<>(); for (String path : paths) { pathSet.add(Path.matches(path)); } Path[] result = Collections.toArray(pathSet, Path.class); return Or.any(result); } });
@Override public Join to(final String resource) { if (this.resourcePattern != null) { throw new IllegalStateException("Cannot set resource path more than once."); } this.resourcePattern = resource; this.resourcePath = Path.matches(resource); Set<String> parameters = getPathRequestParameters(); if (outboundConditionCache == null) { this.outboundConditionCache = resourcePath; for (String name : parameters) { Query parameter = Query.parameterExists(name); outboundConditionCache = outboundConditionCache.and(parameter); } } return this; }
@Override public Join to(final String resource) { if (this.resourcePattern != null) { throw new IllegalStateException("Cannot set resource path more than once."); } this.resourcePattern = resource; this.resourcePath = Path.matches(resource); Set<String> parameters = getPathRequestParameters(); if (outboundConditionCache == null) { this.outboundConditionCache = resourcePath; for (String name : parameters) { Query parameter = Query.parameterExists(name); outboundConditionCache = outboundConditionCache.and(parameter); } } return this; }
@Override public Join to(final String resource) { if (this.resourcePattern != null) { throw new IllegalStateException("Cannot set resource path more than once."); } this.resourcePattern = resource; this.resourcePath = Path.matches(resource); Set<String> parameters = getPathRequestParameters(); if (outboundConditionCache == null) { this.outboundConditionCache = resourcePath; for (String name : parameters) { Query parameter = Query.parameterExists(name); outboundConditionCache = outboundConditionCache.and(parameter); } } return this; }
@Override public void process(ClassContext context, PathPattern annotation, HandlerChain chain) { context.getRuleBuilder().when(Path.matches(annotation.value())); chain.proceed(); }
@Override public void process(ClassContext context, PathPattern annotation, HandlerChain chain) { context.getRuleBuilder().when(Path.matches(annotation.value())); chain.proceed(); }
@Override public Configuration getConfiguration(ServletContext t) { return ConfigurationBuilder.begin() .addRule() .when(Direction.isInbound().and(Path.matches("/"))) .perform(Redirect.temporary("/starter.jsf")); }
@Override protected Configuration narrow(ExampleConfiguration appConfiguration) { if (appConfiguration != null && !Collections.isEmpty(appConfiguration.angularjsRoutes) ) { Set<String> paths = new HashSet<>(appConfiguration.angularjsRoutes); return ConfigurationBuilder.begin() .addRule() .when( Direction.isInbound() .and(Path.matches("/{path}")) .and(matchesAnyOfPaths(paths)) ) .perform( Log.message(Logger.Level.DEBUG, "Forwarding to index.html from {path}") .and(Forward.to("/index.html")) ); } return null; }