Get the converter given a file extension.

@param string $fileExtension

@return ConverterInterface[]
969040
public function getByFileExtension($fileExtension)
    {
        $fileExtension = ltrim($fileExtension);
        $result = [];
        foreach ($this->converters as $converter) {
            if (strcasecmp($fileExtension, $converter->getFileExtension()) === 0) {
                $result[] = $converter;
            }
        }

        return $result;
    }
89207
public function getExtension()
    {
        if (is_null($this->extension) === true) {
            $filename = parent::getFilename();
            $str = new StringWrapper($filename);
            $this->extension = $str->getFirstEndMatch($this->predefinedExtensions);
            $this->hasPredefinedExt = true;

            if ($this->extension === '') {
                $this->hasPredefinedExt = false;
                $this->extension = parent::getExtension();
            }
        }

        return $this->extension;
    }
1150169
public function getFileListByExtensions( $extensions )
	{
		$lister	= new FS_Folder_Lister( $this->folderName );
		$lister->setExtensions( $extensions );
		$lister->showFolders( FALSE );
		return $lister->getList();
	}
573302
public function getExtension($file = "", $default = null)
    {

        $file = (empty($file) && isset($this->file)) ? $this->file : $file;

        if (empty($file)) {
            return $default;
        }

        //Determine the file extension
        return pathinfo($file, PATHINFO_EXTENSION);
    }
638854
public function convertTo($filename)
    {
        $outputExtension = pathinfo($filename, PATHINFO_EXTENSION);
        $supportedExtensions = $this->getAllowedConverter($this->extension);

        if (!in_array($outputExtension, $supportedExtensions)) {
            throw new OfficeConverterException("Output extension({$outputExtension}) not supported for input file({$this->basename})");
        }

        $outdir = $this->tempPath;
        $shell = $this->exec($this->makeCommand($outdir, $outputExtension));
        if ($shell['return'] != 0) {
            throw new OfficeConverterException("Convertion Failure! Contact Server Admin.");
        }

        return $this->prepOutput($outdir, $filename, $outputExtension);
    }
540830
public static function split($fileName)
    {
        $ext = pathinfo($fileName);
        return [
            $ext['dirname'],
            $ext['filename'],
            empty($ext['extension']) ? '' : $ext['extension']
        ];
    }
117721
public function getExtension($extension)
    {
        $uri = $this->base_uri . "/presence/rest/extension/{$extension}";

        $extentionDetails = $this->makeRequest($uri);

        return $extentionDetails;
    }
203613
protected function getExtensions($file)
    {
        $basename = strtolower(pathinfo($file, PATHINFO_BASENAME));

        // normalize
        foreach ($this->composedExtensions as $composedExtension => $canonicalExtension) {
            $basename = preg_replace('/\.'.preg_quote($composedExtension).'(\.|$)/', '.'.$canonicalExtension.'\\1', $basename);
        }

        $extensions = explode('.', $basename);
        $extensions = array_reverse(array_slice($extensions, 1));

        $recognizedExtensions = [];

        $i = 0;
        $extensionsNumber = count($extensions);

        while ($i < $extensionsNumber && array_key_exists($extensions[$i], $this->extensionMap)) {
            $recognizedExtensions[] = $extensions[$i];
            $i++;
        }

        return array_reverse($recognizedExtensions);
    }
73402
public function getMimeTypes($extension)
    {
        if (!array_key_exists($extension, $this->extension_to_mime_types)) {
            return false;
        }

        return $this->extension_to_mime_types[$extension];
    }
780186
protected function getGlobPattern($fileToRotate, $fileExtension = '')
    {

        // load the file information
        $dirname = pathinfo($fileToRotate, PATHINFO_DIRNAME);
        $filename = pathinfo($fileToRotate, PATHINFO_FILENAME);

        // create a glob expression to find all log files
        $glob = str_replace(
            array(LogrotateScanner::FILENAME_FORMAT_PLACEHOLDER, LogrotateScanner::SIZE_FORMAT_PLACEHOLDER),
            array($filename, '[0-9]'),
            $dirname . '/' . $this->getFilenameFormat()
        );

        // append the file extension if available
        if (empty($fileExtension) === false) {
            $glob .= '.' . $fileExtension;
        }

        // return the glob expression
        return $glob;
    }
1240240
public function getBundles($extension = null)
    {
        if ($extension === null) {
            return $this->bundles;
        }
        elseif (isset($this->bundles[$extension])) {
            return $this->bundles[$extension];
        }
        else {
            return null;
        }
    }
1089244
public static function getMediaTypeExtensions(string $mediaType):array
    {
        $mediaType = strtolower($mediaType);
        $extensions = [];
        foreach (self::getMediaTypes() as $extension => $listMediaType) {
            if ($listMediaType == $mediaType) {
                $extensions[] = $extension;
            }
        }
        return $extensions;
    }
1124510
protected static function getFileTypeByExtension(string $extension): int
    {
        switch ($extension) {
            case 'png':
            case 'jpg':
                return FileInterface::TYPE_STATIC_IMAGE;

            case 'gif':
                return FileInterface::TYPE_ANIMATED_IMAGE;

            case 'webm':
            case 'mp4':
            case 'zip':
                return FileInterface::TYPE_VIDEO;

            default:
                throw new InvalidArgumentException(sprintf(
                    'Unknown file type: %s',
                    $extension
                ));
        }
    }
97103
public function listFilesWithExtension(string $extension, array $filter = null, array $sortOrder = null, array $limit = null) {

        $filter[] = array(
            'glue' => ' and',
            'condition' => array(
                'column' => $this->entity['f']['alias'] . '.extension',
                'comparison' => '=',
                'value' => $extension)
        );
        return $this->listFiles($filter, $sortOrder, $limit);
    }
658933
private function getAllowedConverter($extension = null)
    {
        $allowedConverter = [
            ''     => ['pdf'],
            'pptx' => ['pdf'],
            'ppt'  => ['pdf'],
            'pdf'  => ['pdf'],
            'docx' => ['pdf', 'odt', 'html'],
            'doc'  => ['pdf', 'odt', 'html'],
            'wps'  => ['pdf', 'odt', 'html'],
            'dotx' => ['pdf', 'odt', 'html'],
            'docm' => ['pdf', 'odt', 'html'],
            'dotm' => ['pdf', 'odt', 'html'],
            'dot'  => ['pdf', 'odt', 'html'],
            'odt'  => ['pdf', 'html'],
            'xlsx' => ['pdf'],
            'xls'  => ['pdf'],
            'png'  => ['pdf'],
            'jpg'  => ['pdf'],
            'jpeg' => ['pdf'],
            'jfif' => ['pdf'],
            'PPTX' => ['pdf'],
            'PPT'  => ['pdf'],
            'PDF'  => ['pdf'],
            'DOCX' => ['pdf', 'odt', 'html'],
            'DOC'  => ['pdf', 'odt', 'html'],
            'WPS'  => ['pdf', 'odt', 'html'],
            'DOTX' => ['pdf', 'odt', 'html'],
            'DOCM' => ['pdf', 'odt', 'html'],
            'DOTM' => ['pdf', 'odt', 'html'],
            'DOT'  => ['pdf', 'odt', 'html'],
            'ODT'  => ['pdf', 'html'],
            'XLSX' => ['pdf'],
            'XLS'  => ['pdf'],
            'PNG'  => ['pdf'],
            'JPG'  => ['pdf'],
            'JPEG' => ['pdf'],
            'JFIF' => ['pdf'],
            'Pptx' => ['pdf'],
            'Ppt'  => ['pdf'],
            'Pdf'  => ['pdf'],
            'Docx' => ['pdf', 'odt', 'html'],
            'Doc'  => ['pdf', 'odt', 'html'],
            'Wps'  => ['pdf', 'odt', 'html'],
            'Dotx' => ['pdf', 'odt', 'html'],
            'Docm' => ['pdf', 'odt', 'html'],
            'Dotm' => ['pdf', 'odt', 'html'],
            'Dot'  => ['pdf', 'odt', 'html'],
            'Ddt'  => ['pdf', 'html'],
            'Xlsx' => ['pdf'],
            'Xls'  => ['pdf'],
            'Png'  => ['pdf'],
            'Jpg'  => ['pdf'],
            'Jpeg' => ['pdf'],
            'Jfif' => ['pdf'],
            'rtf'  => ['docx', 'txt']
        ];

        if ($extension !== null) {
            if (isset($allowedConverter[$extension])) {
                return $allowedConverter[$extension];
            }

            return [];
        }

        return $allowedConverter;
    }
578440
private function normalizeFileExtension($extension = null)
    {
        $extension = strtolower($extension ? $extension : $this->extension);

        if ($extension == 'jpeg') {
                $extension = 'jpg';
        }

        return $extension;
    }
667632
public function getExtension() {
		$filename = $this->getFilename();
		$pos = strrpos($filename, '.');
		if($pos === false || $pos === 0 || $pos >= strlen($filename) - 1) {
			return null;
		}
		return substr($filename, $pos + 1);
	}