org.tinygroup.weblayer.util
public class TinyPathMatcher extends Object
| Constructor and 描述 |
|---|
TinyPathMatcher() |
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–2015 TinyGroup. All rights reserved.