public UrlBuilder append ( boolean encode , String ... postFix ) { for ( String part : postFix ) { if ( StringUtils . isNotBlank ( part ) ) { if ( url . charAt ( url . length ( ) - 1 ) != ' ' && ! part . startsWith ( "/" ) ) { url . append ( ' ' ) ; } if ( encode ) { try { url . append ( URLEncoder . encode ( part , "UTF-8" ) ) ; } catch ( UnsupportedEncodingException e ) { throw new IllegalStateException ( e ) ; } } else { url . append ( part ) ; } } } return this ; }
Appends one or more postfixes and separates them by slashes .