code: public void connect() throws IOException {
          if (connected) {
              return;  // Ignore
          }
          connected = true;
          connect(url, null, null, maxRedirects);
      }
docs: Opens a communications link to the resource referenced by this
  URL, if such a connection has not already been established.
  <p/>
  If the {@code connect} method is called when the connection
  has already been opened (indicated by the {@code connected}
  field having the value {@code true}), the call is ignored.
  <p/>
  URLConnection objects go through two phases: first they are
  created, then they are connected.  After being created, and
  before being connected, various options can be specified
  (e.g., doInput and UseCaches).  After connecting, it is an
  error to try to set them.  Operations that depend on being
  connected, like getContentLength, will implicitly perform the
  connection, if necessary.
  
  @throws IOException if an I/O error occurs while opening the
  connection.
  @see java.net.URLConnection#connected
  @see <A href="http://www.w3.org/Protocols/rfc2616/rfc2616.html">RFC 2616</A>