类 AntPathMatcher
- java.lang.Object
-
- net.risedata.rpc.utils.AntPathMatcher
-
public class AntPathMatcher extends Object
shiro url 匹配算法工具
-
-
字段概要
字段 修饰符和类型 字段 说明 static StringDEFAULT_PATH_SEPARATORDefault path separator: "/"
-
构造器概要
构造器 构造器 说明 AntPathMatcher()
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected booleandoMatch(String pattern, String path, boolean fullMatch)Actually match the givenpathagainst the givenpattern.StringextractPathWithinPattern(String pattern, String path)Given a pattern and a full path, determine the pattern-mapped part.booleanisPattern(String path)booleanmatch(String pattern, String path)booleanmatches(String pattern, String source)booleanmatchStart(String pattern, String path)voidsetPathSeparator(String pathSeparator)Set the path separator to use for pattern parsing.
-
-
-
方法详细资料
-
setPathSeparator
public void setPathSeparator(String pathSeparator)
Set the path separator to use for pattern parsing. Default is "/", as in Ant.
-
isPattern
public boolean isPattern(String path)
-
doMatch
protected boolean doMatch(String pattern, String path, boolean fullMatch)
Actually match the givenpathagainst the givenpattern.- 参数:
pattern- the pattern to match againstpath- the path String to testfullMatch- whether a full pattern match is required (else a pattern match as far as the given base path goes is sufficient)- 返回:
trueif the suppliedpathmatched,falseif it didn't
-
extractPathWithinPattern
public String extractPathWithinPattern(String pattern, String path)
Given a pattern and a full path, determine the pattern-mapped part.For example:
- '
/docs/cvs/commit.html' and '/docs/cvs/commit.html-> '' - '
/docs/*' and '/docs/cvs/commit-> 'cvs/commit' - '
/docs/cvs/*.html' and '/docs/cvs/commit.html-> 'commit.html' - '
/docs/**' and '/docs/cvs/commit-> 'cvs/commit' - '
/docs/**\/*.html' and '/docs/cvs/commit.html-> 'cvs/commit.html' - '
/*.html' and '/docs/cvs/commit.html-> 'docs/cvs/commit.html' - '
*.html' and '/docs/cvs/commit.html-> '/docs/cvs/commit.html' - '
*' and '/docs/cvs/commit.html-> '/docs/cvs/commit.html'
Assumes that
match(java.lang.String, java.lang.String)returnstruefor 'pattern' and 'path', but does not enforce this. - '
-
-