@Override
protected void writeExtraction() throws AsyncApiException, ExtractException, DataAccessObjectException {
if (this.batch.getState() == BatchStateEnum.Failed)
throw new ExtractException("Batch failed: " + this.batch.getStateMessage());
final QueryResultList results = getController().getBulkClient().getClient()
.getQueryResultList(this.batch.getJobId(), this.batch.getId());
for (final String resultId : results.getResult()) {
if (getProgressMonitor().isCanceled()) return;
try {
final InputStream resultStream = getController().getBulkClient().getClient()
.getQueryResultStream(this.batch.getJobId(), this.batch.getId(), resultId);
try {