/**
  * Will take a single KalturaBatchJob and delete the given file 
  * 
  * @param KalturaBatchJob $job
  * @param KalturaStorageDeleteJobData $data
  * @return KalturaBatchJob
  */
 private function delete(KalturaBatchJob $job, KalturaStorageDeleteJobData $data)
 {
     $exportEngine = KExportEngine::getInstance($job->jobSubType, $job->partnerId, $data);
     $this->updateJob($job, "Deleting {$data->destFileSyncStoredPath} from remote storage", KalturaBatchJobStatus::QUEUED);
     $exportEngine->delete();
     return $this->closeJob($job, null, null, null, KalturaBatchJobStatus::FINISHED);
 }
 function __construct($data, $jobSubType)
 {
     parent::__construct($data);
     $this->protocol = $jobSubType;
     $this->srcFile = str_replace('//', '/', trim($this->data->srcFileSyncLocalPath));
     $this->destFile = str_replace('//', '/', trim($this->data->destFileSyncStoredPath));
 }
 protected function closeStorageExport(KalturaBatchJob $job)
 {
     KalturaLog::info("Attempting to close the job");
     $storageExportEngine = KExportEngine::getInstance($job->jobSubType, $job->partnerId, $job->data);
     $closeResult = $storageExportEngine->verifyExportedResource();
     $this->closeJob($job, null, null, null, $closeResult ? KalturaBatchJobStatus::FINISHED : KalturaBatchJobStatus::ALMOST_DONE);
 }
 function __construct($data, $jobSubType)
 {
     KalturaLog::debug("initializing export process");
     parent::__construct($data);
     $this->protocol = $jobSubType;
     $this->srcFile = str_replace('//', '/', trim($this->data->srcFileSyncLocalPath));
     $this->destFile = str_replace('//', '/', trim($this->data->destFileSyncStoredPath));
 }
 /**
  * Will take a single KalturaBatchJob and export the given file 
  * 
  * @param KalturaBatchJob $job
  * @param KalturaStorageExportJobData $data
  * @return KalturaBatchJob
  */
 protected function export(KalturaBatchJob $job, KalturaStorageExportJobData $data)
 {
     $engine = KExportEngine::getInstance($job->jobSubType, $job->partnerId, $data);
     if (!$engine) {
         return $this->closeJob($job, KalturaBatchJobErrorTypes::APP, KalturaBatchJobAppErrors::ENGINE_NOT_FOUND, "Engine not found", KalturaBatchJobStatus::FAILED);
     }
     $this->updateJob($job, null, KalturaBatchJobStatus::QUEUED);
     $exportResult = $engine->export();
     return $this->closeJob($job, null, null, null, $exportResult ? KalturaBatchJobStatus::FINISHED : KalturaBatchJobStatus::ALMOST_DONE, $data);
 }