AsyncResult asyncResult = metadatabinding.deploy(readZipFile(DEPLOY_ZIP), deployOptions);
// Wait for the deploy to complete
waitForAsyncResult(metadatabinding, new AsyncResult[] {asyncResult}, true, DEPLOY_ZIP);
DeployResult result = metadatabinding.checkDeployStatus(asyncResult.getId());
// Log any messages
StringBuilder buf = new StringBuilder();
if (result.getMessages() != null) {
for (DeployMessage rm : result.getMessages()) {
if (rm.getProblem() != null) {
buf.append("Error deploying: " + rm.getFileName() + " - " + rm.getProblem() + " \n ");
}
}
}