public URI build ( ) { try { String uriString = String . format ( "%s%s" , baseUri . toASCIIString ( ) , ( path . isEmpty ( ) ? "" : path ) ) ; if ( qParams != null && qParams . size ( ) > 0 ) { //Add queries together if both exist if ( ! completeQuery . isEmpty ( ) ) { uriString = String . format ( "%s?%s&%s" , uriString , getJoinedQuery ( qParams . getParams ( ) ) , completeQuery ) ; } else { uriString = String . format ( "%s?%s" , uriString , getJoinedQuery ( qParams . getParams ( ) ) ) ; } } else if ( ! completeQuery . isEmpty ( ) ) { uriString = String . format ( "%s?%s" , uriString , completeQuery ) ; } return new URI ( uriString ) ; } catch ( URISyntaxException e ) { throw new IllegalArgumentException ( e ) ; } }
Build and return the complete URI containing values such as the document ID attachment ID and query syntax .