code: @Override
     public void connect() throws IOException
     {
        if (connected)
           return;
  
        try
        {
           session =
              sessionProvider.getSession(sessionProvider.getCurrentWorkspace(), sessionProvider.getCurrentRepository());
  
           Node node = null;
           if (nodeReference.isPath())
           {
              node = (Node)session.getItem(nodeReference.getPath());
           }
           else if (nodeReference.isIdentitifier())
           {
              node = session.getNodeByUUID(nodeReference.getIdentitifier().getString());
           }
           else
           {
              throw new IllegalArgumentException("Absolute path or Identifier was not found!");
           }
  
           nodeRepresentation = nodeRepresentationService.getNodeRepresentation(node, "text/xml");
           connected = true;
        }
        catch (Exception e)
        {
           //e.printStackTrace();
           throw new IOException("Connection refused!", e);
        }
     }
docs: /*
  (non-Javadoc)
  @see java.net.URLConnection#connect()