private function getLocalXmlFilePath()
 {
     $dropFolderFilePath = $this->dropFolder->path . '/' . $this->dropFolderFile->fileName;
     // local drop folder
     if ($this->dropFolder->type == KalturaDropFolderType::LOCAL) {
         $dropFolderFilePath = realpath($dropFolderFilePath);
         return $dropFolderFilePath;
     }
     // remote drop folder
     $tempFilePath = tempnam($this->tempDirectory, 'dropFolderFileId_' . $this->dropFolderFile->id . '_');
     $this->fileTransferMgr->getFile($dropFolderFilePath, $tempFilePath);
     return $tempFilePath;
 }
Exemplo n.º 2
0
 public function getLocalFilePath($fileName, $fileId, kFileTransferMgr $fileTransferMgr)
 {
     $dropFolderFilePath = $this->getPath() . '/' . $fileName;
     $tempDirectory = sys_get_temp_dir();
     if (is_dir($tempDirectory)) {
         $tempFilePath = tempnam($tempDirectory, 'parse_dropFolderFileId_' . $fileId . '_');
         $fileTransferMgr->getFile($dropFolderFilePath, $tempFilePath);
         return $tempFilePath;
     } else {
         KalturaLog::err('Missing temporary directory');
         return null;
     }
 }
 /**
  * Local drop folder - constract full path
  * Remote drop folder - download file to a local temp directory and return the temp file path
  * @param string $fileName
  * @param int $fileId
  * @throws Exception
  */
 protected function getLocalFilePath($fileName, $fileId)
 {
     $dropFolderFilePath = $this->dropFolder->path . '/' . $fileName;
     // local drop folder
     if ($this->dropFolder->type == KalturaDropFolderType::LOCAL) {
         $dropFolderFilePath = realpath($dropFolderFilePath);
         return $dropFolderFilePath;
     } else {
         // remote drop folder
         $tempFilePath = tempnam(KBatchBase::$taskConfig->params->sharedTempPath, 'parse_dropFolderFileId_' . $fileId . '_');
         $this->fileTransferMgr->getFile($dropFolderFilePath, $tempFilePath);
         $this->setFilePermissions($tempFilePath);
         return $tempFilePath;
     }
 }
 /**
  * Tests kFileTransferMgr->getFile()
  */
 public function testGetFile()
 {
     // TODO Auto-generated kFileTransferMgrTest->testGetFile()
     $this->markTestIncomplete("getFile test not implemented");
     $this->kFileTransferMgr->getFile();
 }