code: public URL constructURL() throws InvalidRequestException {	
   
          String stringUri = url;
  
          try {
              URI uri = new URI(stringUri);
              return uri.toURL();
          } catch (final URISyntaxException e) {
              throw new InvalidRequestException("Bad URI: " + stringUri, e);
          } catch (final MalformedURLException e) {
              throw new InvalidRequestException("Bad URL: " + stringUri, e);
          }
      }
docs: Prepares request URL
  
  @return
  @throws InvalidRequestException