private static ImmutableList < String > computePathPrefixes ( String path ) { List < String > pieces = Q_NAME_SPLITTER . splitToList ( path ) ; ImmutableList . Builder < String > pathPrefixes = ImmutableList . builder ( ) ; String partial = pieces . get ( 0 ) ; // There will always be at least 1. pathPrefixes . add ( partial ) ; for ( int i = 1 ; i < pieces . size ( ) ; i ++ ) { partial = Q_NAME_JOINER . join ( partial , pieces . get ( i ) ) ; pathPrefixes . add ( partial ) ; } return pathPrefixes . build ( ) ; }
Computes a list of the path prefixes constructed from the components of the path .