code: @Override
      public ExitStatus afterStep(StepExecution stepExecution) {
          ExitStatus status = stepExecution.getExitStatus();
  
          List<String> errors = getErrors();
          if (errors.isEmpty()) {
              try {
                  RestoreStatus newStatus = RestoreStatus.TRANSFER_TO_DURACLOUD_COMPLETE;
                  restoreManager.transitionRestoreStatus(restorationId, newStatus, "");
  
                  // restore the snapshot props file to the data directory.
                  restoreFile(new File(this.watchDir.getParentFile(), Constants.SNAPSHOT_PROPS_FILENAME),
                              watchDir.getParentFile());
                  return status.and(ExitStatus.COMPLETED);
  
              } catch (Exception e) {
                  String message = "failed to transition restore status: " + e.getMessage();
                  log.error(message, e);
                  return status.and(ExitStatus.FAILED).addExitDescription(message);
              }
  
          } else {
  
              status = status.and(ExitStatus.FAILED);
              status.addExitDescription("Transfer to DuraCloud failed: " +
                                        errors.size() + " items failed.");
              for (String error : errors) {
                  status.addExitDescription(error);
              }
  
              resetContextState();
  
              return status;
          }
      }
docs: /*
  (non-Javadoc)
  
  @see org.springframework.batch.core.StepExecutionListener#afterStep(org.
  springframework.batch.core.StepExecution)