try { getConnection().connect(); } catch(IOException ioe) { logger.log(Level.WARNING, "Unable to connect to the server", ioe); }
getConnection().connect();
   public void sendRequestHeaders()   {      // Set the request method      try      {         getConnection().setRequestMethod(getRequestMethod());      }      catch(ProtocolException e)      {         logger.log(Level.WARNING, "Unable to set method", e);      }      // Set the request headers      Parameter header;      for(Iterator<Parameter> iter = getRequestHeaders().iterator(); iter.hasNext();)      {         header = iter.next();         getConnection().addRequestProperty(header.getName(), header.getValue());      }      // Ensure that the connections is active      try      {         getConnection().connect();      }      catch(IOException ioe)      {         logger.log(Level.WARNING, "Unable to connect to the server", ioe);      }   }