code: public synchronized void waitForEnd()
  	throws ServerException,
  	       ClientException,
  	       IOException {
          try {
              while(!isDone() && !hasError()) {
                  wait();
              }
          } catch(InterruptedException e) {
              // break
          }
  	    checkError();
      }
docs: Blocks until the transfer is complete or
  the transfer fails.