eu.etaxonomy.cdm.remote.controller.util
Class CdmAntPathMatcher

java.lang.Object
  extended by org.springframework.util.AntPathMatcher
      extended by eu.etaxonomy.cdm.remote.controller.util.CdmAntPathMatcher
All Implemented Interfaces:
org.springframework.util.PathMatcher

public class CdmAntPathMatcher
extends org.springframework.util.AntPathMatcher

Author:
a.kohlbecker

Field Summary
 
Fields inherited from class org.springframework.util.AntPathMatcher
DEFAULT_PATH_SEPARATOR
 
Constructor Summary
CdmAntPathMatcher()
           
 
Method Summary
 String combine(String pattern1, String pattern2)
          Changes the combination behavior of the overridden method AntPathMatcher.combine(String, String) only a little but quite useful bit:
 
Methods inherited from class org.springframework.util.AntPathMatcher
doMatch, extractPathWithinPattern, extractUriTemplateVariables, getPatternComparator, isPattern, match, matchStart, setPathSeparator, setTrimTokens
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CdmAntPathMatcher

public CdmAntPathMatcher()
Method Detail

combine

public String combine(String pattern1,
                      String pattern2)
Changes the combination behavior of the overridden method AntPathMatcher.combine(String, String) only a little but quite useful bit:

If the pattern2 is an absolute path, that is it starts with an slash character, the pattern2 overrules pattern1 and no combined at all is performed. I such case the method just returns pattern2

For example:

Pattern 1Pattern 2Result
/hotelsnull/hotels
null/hotels/hotels
/hotels/bookings/bookings
/hotelsbookings/hotels/bookings
/hotels/*bookings/hotels/bookings
/hotels/*/bookings/bookings
/hotels/**/bookings/bookings
/hotels/**bookings/hotels/**/bookings
/hotels{hotel}/hotels/{hotel}
/hotels/*{hotel}/hotels/{hotel}
/hotels/**{hotel}/hotels/**/{hotel}
/*.htmlhotels.html/hotels.html
/*.html/hotels.html/hotels.html
/*.htmlhotels/hotels.html
/*.html/hotels/hotels
/*.html/*.txtIllegalArgumentException

Specified by:
combine in interface org.springframework.util.PathMatcher
Overrides:
combine in class org.springframework.util.AntPathMatcher
Parameters:
pattern1 -
pattern2 -


Copyright © 2007-2013 EDIT. All Rights Reserved.