private void waitForProgressObject(ProgressObject progressObject) throws CargoException {
  long timeout=System.currentTimeMillis() + this.timeout;
  while (System.currentTimeMillis() < timeout) {
    try {
      Thread.sleep(1000);
    }
 catch (    InterruptedException e) {
      throw new CargoException("Thread.sleep has failed",e);
    }
    DeploymentStatus status=progressObject.getDeploymentStatus();
    if (status.isCompleted()) {
      return;
    }
 else     if (status.isFailed()) {
      throw new CargoException("Deployment has failed: " + status.getMessage());
    }
  }
  throw new CargoException("Deployment has timed out after " + this.timeout + " milliseconds");
}

private void waitForProgressObject ( ProgressObject progressObject ) throws CargoException { long timeout = System . currentTimeMillis ( ) + this . timeout ; while ( System . currentTimeMillis ( ) < timeout ) { try { Thread . sleep ( 1000 ) ; } catch ( InterruptedException e ) { throw new CargoException ( "Thread.sleep has failed" , e ) ; } DeploymentStatus status = progressObject . getDeploymentStatus ( ) ; if ( status . isCompleted ( ) ) { return ; } else if ( status . isFailed ( ) ) { throw new CargoException ( "Deployment has failed: " + status . getMessage ( ) ) ; } } throw new CargoException ( "Deployment has timed out after " + this . timeout + " milliseconds" ) ; }
waits for a progress object .
