proxyStorageBackend == null) { $this->proxyStorageBackend = new ProxyStorageBackend($this->getStorageBackend()); } return $this->proxyStorageBackend->getDownloadURLs($this->getResourceId(), $this->getFilename()); } /** * Returns a url to the file's object on Amazon S3. */ public function getAbsoluteFilePath() { if ($this->proxyStorageBackend == null) { $this->proxyStorageBackend = new ProxyStorageBackend($this->getStorageBackend()); } return $this->proxyStorageBackend->getAbsoluteFilePath($this->getResourceId()); } public function getFilename() { $filename = $this->getDbFilepath(); $info = pathinfo($filename); //Add the correct file extension based on the MIME type, for files that were uploaded with the wrong extension. $mime = $this->getDbMime(); $extension = FileDataHelper::getFileExtensionFromMime($mime); return $info['filename'] . $extension; } /** * Checks if the file is a regular file that can be previewed and downloaded. */ public function isValidPhysicalFile() { // We don't need to check if the cloud file is a valid file because // before it is imported the Analyzer runs it through Liquidsoap // to check its playability. If Liquidsoap can't play the file it // does not get imported into the Airtime library. return true; } /** * Deletes the file from cloud storage. */ public function deletePhysicalFile() { if ($this->proxyStorageBackend == null) { $this->proxyStorageBackend = new ProxyStorageBackend($this->getStorageBackend()); } $this->proxyStorageBackend->deletePhysicalFile($this->getResourceId()); } /** * Deletes the cc_file and cloud_file entries from the database. */ public function delete(PropelPDO $con = null) { CcFilesQuery::create()->findPk($this->getCcFileId())->delete(); parent::delete(); } }