private void validatePossibleEndpoint ( String possibleEndpoint ) throws IllegalArgumentException { if ( ! possibleEndpoint . contains ( ":" ) ) { throw new IllegalArgumentException ( RESTClientMessagesUtil . getMessage ( RESTClientMessagesUtil . INVALID_ENDPOINT , possibleEndpoint ) ) ; } String [ ] components = possibleEndpoint . split ( ":" ) ; if ( components . length != 2 ) { throw new IllegalArgumentException ( RESTClientMessagesUtil . getMessage ( RESTClientMessagesUtil . INVALID_ENDPOINT , possibleEndpoint ) ) ; } try { Integer . valueOf ( components [ 1 ] ) ; } catch ( NumberFormatException e ) { throw new IllegalArgumentException ( RESTClientMessagesUtil . getMessage ( RESTClientMessagesUtil . INVALID_ENDPOINT , possibleEndpoint ) ) ; } }
Validate the possible endpoint String .