public function fileExists($filename)
    {
        if ($this->mediaDirectory->isFile($filename)) {
            return true;
        } else {
            return $this->coreFileStorageDatabase->saveFileToFilesystem(
                $this->mediaDirectory->getAbsolutePath($filename)
            );
        }
    }
public function fileExists($filename)
    {
        if ($this->mediaDirectory->isFile($filename)) {
            return true;
        } else {
            return $this->coreFileStorageDatabase->saveFileToFilesystem(
                $this->mediaDirectory->getAbsolutePath($filename)
            );
        }
    }
public function fileExists ( $ filename ) { if ( $ this -> mediaDirectory -> isFile ( $ filename ) ) { return true ; } else { return $ this -> coreFileStorageDatabase -> saveFileToFilesystem ( $ this -> mediaDirectory -> getAbsolutePath ( $ filename ) ) ; } }
First check this file on FS
If it doesn't exist - try to download it from DB

@param string $filename
@return bool
First check this file on FS If it doesn t exist - try to download it from DB