protected function saveFile($path, $name)
    {
        $filename = $this->getUniqueFilename($name);

        /** @var \oat\oatbox\filesystem\Directory $dir */
        $dir = $this->getServiceManager()->get(FileSystemService::SERVICE_ID)
            ->getDirectory(Queue::FILE_SYSTEM_ID);
        /** @var \oat\oatbox\filesystem\FileSystem $filesystem */
        $filesystem = $dir->getFileSystem();

        $stream = fopen($path, 'r+');
        $filesystem->writeStream($filename, $stream);
        fclose($stream);

        $file = $dir->getFile($filename);
        return $this->getFileReferenceSerializer()->serialize($file);
    }
protected function saveFile($path, $name)
    {
        $filename = $this->getUniqueFilename($name);

        /** @var \oat\oatbox\filesystem\Directory $dir */
        $dir = $this->getServiceManager()->get(FileSystemService::SERVICE_ID)
            ->getDirectory(Queue::FILE_SYSTEM_ID);
        /** @var \oat\oatbox\filesystem\FileSystem $filesystem */
        $filesystem = $dir->getFileSystem();

        $stream = fopen($path, 'r+');
        $filesystem->writeStream($filename, $stream);
        fclose($stream);

        $file = $dir->getFile($filename);
        return $this->getFileReferenceSerializer()->serialize($file);
    }
protected function saveFile ( $ path , $ name ) { $ filename = $ this -> getUniqueFilename ( $ name ) ; /** @var \oat\oatbox\filesystem\Directory $dir */ $ dir = $ this -> getServiceManager ( ) -> get ( FileSystemService :: SERVICE_ID ) -> getDirectory ( Queue :: FILE_SYSTEM_ID ) ; /** @var \oat\oatbox\filesystem\FileSystem $filesystem */ $ filesystem = $ dir -> getFileSystem ( ) ; $ stream = fopen ( $ path , 'r+' ) ; $ filesystem -> writeStream ( $ filename , $ stream ) ; fclose ( $ stream ) ; $ file = $ dir -> getFile ( $ filename ) ; return $ this -> getFileReferenceSerializer ( ) -> serialize ( $ file ) ; }
Save and serialize file into task queue filesystem.

@param string $path file path
@param string $name file name
@return string file reference uri
Save and serialize file into task queue filesystem .