public static ResourceName create ( PathTemplate template , String path ) { ImmutableMap < String , String > values = template . match ( path ) ; if ( values == null ) { throw new ValidationException ( "path '%s' does not match template '%s'" , path , template ) ; } return new ResourceName ( template , values , null ) ; }
Creates a new resource name based on given template and path . The path must match the template otherwise null is returned .