private StringBuilder buildFlowURL ( String cluster , String username , String batchDesc , String signature , int limit , List < String > flowResponseFilters , List < String > jobResponseFilters ) throws IOException { StringBuilder urlStringBuilder = new StringBuilder ( ) ; urlStringBuilder . append ( "http://" ) ; urlStringBuilder . append ( apiHostname ) ; urlStringBuilder . append ( RestJSONResource . SLASH ) ; urlStringBuilder . append ( URL_PORTION_API_V1 ) ; urlStringBuilder . append ( FLOW_API ) ; urlStringBuilder . append ( RestJSONResource . SLASH ) ; urlStringBuilder . append ( cluster ) ; urlStringBuilder . append ( RestJSONResource . SLASH ) ; urlStringBuilder . append ( username ) ; urlStringBuilder . append ( RestJSONResource . SLASH ) ; urlStringBuilder . append ( StringUtil . cleanseToken ( batchDesc ) ) ; if ( StringUtils . isNotEmpty ( signature ) ) { urlStringBuilder . append ( RestJSONResource . SLASH ) ; urlStringBuilder . append ( signature ) ; } urlStringBuilder . append ( QUESTION_MARK ) ; urlStringBuilder . append ( LIMIT ) ; urlStringBuilder . append ( EQUAL_TO ) ; urlStringBuilder . append ( limit ) ; if ( ( flowResponseFilters != null ) && ( flowResponseFilters . size ( ) > 0 ) ) { urlStringBuilder . append ( AND ) ; urlStringBuilder . append ( StringUtil . buildParam ( "include" , flowResponseFilters ) ) ; } if ( ( jobResponseFilters != null ) && ( jobResponseFilters . size ( ) > 0 ) ) { urlStringBuilder . append ( AND ) ; urlStringBuilder . append ( StringUtil . buildParam ( "includeJobField" , jobResponseFilters ) ) ; } return urlStringBuilder ; }
builds up a StringBuilder with the parameters for the FLOW API