private static String toCanonicalName ( String key , String root ) { if ( key . startsWith ( "/" ) || key . startsWith ( "\\" ) ) { key = key . substring ( 1 ) ; } if ( key . startsWith ( root ) ) { key = key . replace ( root , "" ) ; } if ( key . startsWith ( "/" ) || key . startsWith ( "\\" ) ) { key = key . substring ( 1 ) ; } //if (-1 != pos) key = key.substring(0, pos); key = key . replace ( ' ' , ' ' ) . replace ( ' ' , ' ' ) ; return key ; }
Convert the key to canonical template name