code: private static InputStream configuredInputStream(Map parameters, URL url) throws IOException {
          final URLConnection connection = url.openConnection();
          if (parameters != null) {
              if (parameters.containsKey("connectTimeout")) {
                  connection.setConnectTimeout(DefaultGroovyMethods.asType(parameters.get("connectTimeout"), Integer.class));
              }
              if (parameters.containsKey("readTimeout")) {
                  connection.setReadTimeout(DefaultGroovyMethods.asType(parameters.get("readTimeout"), Integer.class));
              }
              if (parameters.containsKey("useCaches")) {
                  connection.setUseCaches(DefaultGroovyMethods.asType(parameters.get("useCaches"), Boolean.class));
              }
              if (parameters.containsKey("allowUserInteraction")) {
                  connection.setAllowUserInteraction(DefaultGroovyMethods.asType(parameters.get("allowUserInteraction"), Boolean.class));
              }
              if (parameters.containsKey("requestProperties")) {
                  @SuppressWarnings("unchecked")
                  Map<String, String> properties = (Map<String, String>) parameters.get("requestProperties");
                  for (Map.Entry<String, String> entry : properties.entrySet()) {
                      connection.setRequestProperty(entry.getKey(), entry.getValue());
                  }
              }
  
          }
          return connection.getInputStream();
      }
docs: Creates an inputstream for this URL, with the possibility to set different connection parameters using the
  <i>parameters map</i>:
  <ul>
  <li>connectTimeout : the connection timeout</li>
  <li>readTimeout : the read timeout</li>
  <li>useCaches : set the use cache property for the URL connection</li>
  <li>allowUserInteraction : set the user interaction flag for the URL connection</li>
  <li>requestProperties : a map of properties to be passed to the URL connection</li>
  </ul>
  
  @param parameters an optional map specifying part or all of supported connection parameters
  @param url        the url for which to create the inputstream
  @return an InputStream from the underlying URLConnection
  @throws IOException if an I/O error occurs while creating the input stream
  @since 1.8.1