public class TinyPathMatcher extends Object
系统版本: v1.0
开发人员: renhui
开发时间: 2013-5-15
功能描述: 写明作用,调用方式,使用场景,以及特殊情况
public String combine(String pattern1, String pattern2)
This implementation simply concatenates the two patterns, unless the first pattern
contains a file extension match (such as *.html. In that case, the second pattern
should be included in the first, or an IllegalArgumentException is thrown.
For example:
| Pattern 1 | Pattern 2 | Result |
|---|---|---|
| /hotels | null | /hotels |
null | /hotels | /hotels |
| /hotels | /bookings | /hotels/bookings |
| /hotels | bookings | /hotels/bookings |
| /hotels/* | /bookings | /hotels/bookings |
| /hotels/** | /bookings | /hotels/**/bookings |
| /hotels | {hotel} | /hotels/{hotel} |
| /hotels/* | {hotel} | /hotels/{hotel} |
| /hotels/** | {hotel} | /hotels/**/{hotel} |
| /*.html | /hotels.html | /hotels.html |
| /*.html | /hotels | /hotels.html |
| /*.html | /*.txt | IllegalArgumentException |
pattern1 - the first patternpattern2 - the second patternIllegalArgumentException - when the two patterns cannot be combinedCopyright © 2006-2013 开源组织. All Rights Reserved.