protected function generateMedia(
        $fileName,
        $folderReference,
        $name,
        array $keywordReferencesArray,
        array $languagesArray
    ) {
        $folder = $this->getReference($folderReference);
        $filePath = __DIR__ . '/Files/' . $fileName;
        $tmpFilePath = $this->container->getParameter('open_orchestra_media_admin.tmp_dir')
            . DIRECTORY_SEPARATOR . $fileName;

        copy($filePath, $tmpFilePath);

        $finfo = finfo_open(FILEINFO_MIME_TYPE);
        $mimeType = finfo_file($finfo, $tmpFilePath);
        finfo_close($finfo);

        $uploadedFile = new UploadedFile($tmpFilePath, $fileName, $mimeType);

        $saveMediaManager = $this->container->get('open_orchestra_media_admin.manager.save_media');
        $media = $saveMediaManager->initializeMediaFromUploadedFile($uploadedFile, $folder->getId(), $folder->getSiteId());
        $media->setName($name);
        foreach ($keywordReferencesArray as $keywordReference) {
            $media->addKeyword($this->getReference($keywordReference));
        }
        foreach ($languagesArray as $language => $labels) {
            $media->addTitle($language, $labels['title']);
        }

        $saveMediaManager->saveMedia($media);

        return $media;
    }