public SimpleAppResource(Resource resource, boolean defaultOverride, float order, String path) { this.resource = resource; this.defaultOverride = defaultOverride; this.order = order; this.path = Paths.prefixWithoutSlash(path); }
/** * This implementation returns the name of the file that this class path * resource refers to. * @see org.springframework.util.StringUtils#getFileName(String) */ @Override public String getFilename() { return Paths.getFileName(this.path); }
/** Construct a new instance of the <code>AntPatchStringMatcher</code>. */ AntPathStringMatcher(String pattern, String str, Map<String, String> uriTemplateVariables) { this.str = str; this.uriTemplateVariables = uriTemplateVariables; this.pattern = createPattern(pattern); }
public AuthzClientBuilder setRedirectUriPattern(String antPathPattern) { this.redirectUriPattern = new AntPathPattern(antPathPattern); return this; }
@ConfigProperty public void setDirectServerUrl(String directServerUrl) {//don't change the parameter name (used by config property) directServerUrl = Paths.suffixWithoutSlash(directServerUrl); this.tokenUrl = directServerUrl + "/oauth2/token"; this.tokenInfoUrl = directServerUrl + "/oauth2/tokeninfo"; this.userInfoUrl = directServerUrl + "/oauth2/userinfo"; this.publicKeyUrl = directServerUrl + "/oauth2/publickey"; }
public RestdModel(EntityMapping entityMapping, String path, Map<String,Object> attrs) { super(attrs); this.entityMapping = entityMapping; this.path = Paths.prefixWithAndSuffixWithoutSlash(path); }
/** * Returns true if the path pattern matches the given path. */ default boolean matches(String path) { return getPattern().matches(path); }
protected boolean matchPatterns(String path){ for(int i=0;i<patterns.length;i++){ if(patternMatcher.match(patterns[i], path)){ return true; } } return false; }
/** * Create a new ClassPathResource with optional ClassLoader and Class. * Only for internal usage. * @param path relative or absolute path within the classpath * @param classLoader the class loader to load the resource with, if any * @param clazz the class to load resources with, if any */ protected ClassPathResource(String path, ClassLoader classLoader, Class<?> clazz) { this.path = Paths.normalize(path); this.classLoader = classLoader; this.clazz = clazz; }
/** * Tests whether or not a string matches against a pattern. The pattern may contain two special characters:<br> '*' * means zero or more characters<br> '?' means one and only one character * @param pattern pattern to match against. Must not be <code>null</code>. * @param str string which must be matched against the pattern. Must not be <code>null</code>. * @return <code>true</code> if the string matches against the pattern, or <code>false</code> otherwise. */ private boolean matchStrings(String pattern, String str, Map<String, String> uriTemplateVariables) { AntPathStringMatcher matcher = new AntPathStringMatcher(pattern, str, uriTemplateVariables); return matcher.matchStrings(); }
public String getPath() { return pattern.pattern(); }
public boolean matchStart(String pattern, String path) { return doMatch(pattern, path, false, null); }
/** * Given a full path, returns a {@link Comparator} suitable for sorting patterns in order of explicitness. * <p>The returned <code>Comparator</code> will {@linkplain java.util.Collections#sort(java.util.List, * java.util.Comparator) sort} a list so that more specific patterns (without uri templates or wild cards) come before * generic patterns. So given a list with the following patterns: <ol> <li><code>/hotels/new</code></li> * <li><code>/hotels/{hotel}</code></li> <li><code>/hotels/*</code></li> </ol> the returned comparator will sort this * list so that the order will be as indicated. * <p>The full path given as parameter is used to test for exact matches. So when the given path is {@code /hotels/2}, * the pattern {@code /hotels/2} will be sorted before {@code /hotels/1}. * @param path the full path to use for comparison * @return a comparator capable of sorting patterns in order of explicitness */ public Comparator<String> getPatternComparator(String path) { return new AntPatternComparator(path); }
@Override public String toString() { return pattern(); }
@Override public boolean matches(String path) { return matcher.match(pattern, path); }
public AuthzClientBuilder setRedirectUriPattern(String antPathPattern) { this.redirectUriPattern = new AntPathPattern(antPathPattern); return this; }
/** * This implementation returns the name of the file that this ServletContext * resource refers to. * @see org.springframework.util.StringUtils#getFilename(String) */ @Override public String getFilename() { return Paths.getFileName(this.path); }
public boolean match(String pattern, String path) { return doMatch(pattern, path, true, null); }
public AntPathIgnore(String path) { this.pattern = new AntPathPattern(path); }