protected String getFullUrl ( String serviceName , String methodName , String id , ResultLimit resultLimit , String maskString ) { StringBuilder url = new StringBuilder ( baseUrl + serviceName ) ; // ID present? add it if ( id != null ) { url . append ( ' ' ) . append ( id ) ; } // Some method names are not included, others can have the "get" stripped if ( methodName . startsWith ( "get" ) && ! "getObject" . equals ( methodName ) ) { url . append ( ' ' ) . append ( methodName . substring ( 3 ) ) ; } else if ( ! IMPLICIT_SERVICE_METHODS . contains ( methodName ) ) { url . append ( ' ' ) . append ( methodName ) ; } url . append ( ".json" ) ; if ( resultLimit != null ) { url . append ( "?resultLimit=" ) . append ( resultLimit . offset ) . append ( ' ' ) . append ( resultLimit . limit ) ; } if ( maskString != null && ! maskString . isEmpty ( ) ) { url . append ( resultLimit == null ? ' ' : ' ' ) ; try { url . append ( "objectMask=" ) . append ( URLEncoder . encode ( maskString , "UTF-8" ) ) ; } catch ( UnsupportedEncodingException e ) { throw new RuntimeException ( e ) ; } } return url . toString ( ) ; }
Get the full REST URL required to make a request .