public RemoteServiceDescriptor(String baseUrl,HttpJsonRequestFactory requestFactory) throws IllegalArgumentException {
  this.baseUrl=baseUrl;
  this.requestFactory=requestFactory;
  try {
    final URL baseUrlURL=new URL(baseUrl);
    final String protocol=baseUrlURL.getProtocol();
    if (!(protocol.equals("http") || protocol.equals("https"))) {
      throw new IllegalArgumentException(String.format("Invalid URL: %s",baseUrl));
    }
  }
 catch (  MalformedURLException e) {
    throw new IllegalArgumentException(String.format("Invalid URL: %s",baseUrl));
  }
}

public RemoteServiceDescriptor ( String baseUrl , HttpJsonRequestFactory requestFactory ) throws IllegalArgumentException { this . baseUrl = baseUrl ; this . requestFactory = requestFactory ; try { final URL baseUrlURL = new URL ( baseUrl ) ; final String protocol = baseUrlURL . getProtocol ( ) ; if ( ! ( protocol . equals ( "http" ) || protocol . equals ( "https" ) ) ) { throw new IllegalArgumentException ( String . format ( "Invalid URL: %s" , baseUrl ) ) ; } } catch ( MalformedURLException e ) { throw new IllegalArgumentException ( String . format ( "Invalid URL: %s" , baseUrl ) ) ; } }
creates new descriptor of remote restful service .
