private URI buildSaltId ( List < String > path , String saltID ) { StringBuilder sb = new StringBuilder ( "salt:/" ) ; Iterator < String > itPath = path . iterator ( ) ; while ( itPath . hasNext ( ) ) { String dir = itPath . next ( ) ; sb . append ( pathEscaper . escape ( dir ) ) ; if ( itPath . hasNext ( ) ) { sb . append ( "/" ) ; } } sb . append ( "#" ) . append ( fragmentEscaper . escape ( saltID ) ) ; URI result ; try { result = new URI ( sb . toString ( ) ) ; return result ; } catch ( URISyntaxException ex ) { log . error ( "Could not generate valid ID from path " + path . toString ( ) + " and node name " + saltID , ex ) ; } return null ; }
Builds a proper salt ID .