This implementation simply concatenates the two patterns, unless the first pattern contains a file extension match (such as {@code *.html}. In that case, the second pattern should be included in the first, or an {@code IllegalArgumentException} is thrown.
For example:
Pattern 1 | Pattern 2 | Result |
---|---|---|
/hotels | {@code null} | /hotels |
{@code 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 |
|
|