/** * Create new instance using existing Client instance, and the URI from which the parameters will be extracted * */ public PathIdRevisions( com.sun.jersey.api.client.Client client, URI uri ) { _client = client; StringBuilder template = new StringBuilder( BASE_URI.toString() ); if ( template.charAt( ( template.length() - 1 ) ) != '/' ) { template.append( "/pur-repository-plugin/api/revision/{pathId : .+}/revisions" ); } else { template.append( "pur-repository-plugin/api/revision/{pathId : .+}/revisions" ); } _uriBuilder = UriBuilder.fromPath( template.toString() ); _templateAndMatrixParameterValues = new HashMap<String, Object>(); com.sun.jersey.api.uri.UriTemplate uriTemplate = new com.sun.jersey.api.uri.UriTemplate( template.toString() ); HashMap<String, String> parameters = new HashMap<String, String>(); uriTemplate.match( uri.toString(), parameters ); _templateAndMatrixParameterValues.putAll( parameters ); }
/** * Create new instance using existing Client instance, and the URI from which the parameters will be extracted * */ public PathIdPurge( com.sun.jersey.api.client.Client client, URI uri ) { _client = client; StringBuilder template = new StringBuilder( BASE_URI.toString() ); if ( template.charAt( ( template.length() - 1 ) ) != '/' ) { template.append( "/pur-repository-plugin/api/purge/{pathId : .+}/purge" ); } else { template.append( "pur-repository-plugin/api/purge/{pathId : .+}/purge" ); } _uriBuilder = UriBuilder.fromPath( template.toString() ); _templateAndMatrixParameterValues = new HashMap<String, Object>(); com.sun.jersey.api.uri.UriTemplate uriTemplate = new com.sun.jersey.api.uri.UriTemplate( template.toString() ); HashMap<String, String> parameters = new HashMap<String, String>(); uriTemplate.match( uri.toString(), parameters ); _templateAndMatrixParameterValues.putAll( parameters ); }
/** * Create new instance using existing Client instance, and the URI from which the parameters will be extracted * */ public PathIdVersioningConfiguration( com.sun.jersey.api.client.Client client, URI uri ) { _client = client; StringBuilder template = new StringBuilder( BASE_URI.toString() ); if ( template.charAt( ( template.length() - 1 ) ) != '/' ) { template.append( "/pur-repository-plugin/api/revision/{pathId}/versioningConfiguration" ); } else { template.append( "pur-repository-plugin/api/revision/{pathId}/versioningConfiguration" ); } _uriBuilder = UriBuilder.fromPath( template.toString() ); _templateAndMatrixParameterValues = new HashMap<String, Object>(); com.sun.jersey.api.uri.UriTemplate uriTemplate = new com.sun.jersey.api.uri.UriTemplate( template.toString() ); HashMap<String, String> parameters = new HashMap<String, String>(); uriTemplate.match( uri.toString(), parameters ); _templateAndMatrixParameterValues.putAll( parameters ); }
/** * Add a rule that matches a 'from' url pattern to a destination (to) url pattern. * @param from The UriTemplate that the route matches on * @param to The UriTemplate that describes the destination url * @param httpVerbs The http verbs that the rule applies to */ public Builder addRule(String from, String to, List<String> httpVerbs) { urlRouteRules.add(new UrlRouteRule(new UriTemplate(from), new UriTemplate(to), httpVerbs, PASS_UNMAPPED)); return this; }
/** * Add a rule that matches a 'from' url pattern to a destination (to) url pattern. * @param from The UriTemplate that the route matches on * @param to The UriTemplate that describes the destination url * @param httpVerbs The http verbs that the rule applies to * @param routePredicate The route predicate that determines if the route should match */ public Builder addRule(String from, String to, List<String> httpVerbs, RoutePredicate routePredicate) { urlRouteRules.add(new UrlRouteRule(new UriTemplate(from), new UriTemplate(to), httpVerbs, PASS_UNMAPPED, routePredicate)); return this; }
/** * Add a rule that matches a 'from' url pattern to a destination (to) url pattern. * @param from The UriTemplate that the route matches on * @param to The UriTemplate that describes the destination url */ public Builder addRule(String from, String to) { urlRouteRules.add(new UrlRouteRule(new UriTemplate(from), new UriTemplate(to), Collections.<String>emptyList(), PASS_UNMAPPED)); return this; }
private UriTemplate createURI(String uriStr) { try { return new UriTemplate(uriStr); } catch (IllegalArgumentException e) { log.error("Unable to parse routing URI " + String.valueOf(uriStr)); return null; } } }
private UriTemplate createURI(String path, String uriStr) { String template = UrlUtils.prependPath(path, uriStr); try { return new UriTemplate(template); } catch (IllegalArgumentException e) { log.error("Unable to parse routing URI " + String.valueOf(template)); return null; } }