@param string|null $extension

@return string
487901
public function get($extension)
    {
        if (null !== $extension && array_key_exists($extension, $this->map)) {
            return $this->map[$extension];
        }

        return $this->defaultMimeType();
    }
533932
public static function purifyExtension($extension)
    {
        $extension = (string)$extension;
        $extension = trim($extension);
        $extension = ltrim($extension, '.');

        return $extension;
    }
452241
public function extensions($extensions = null)
    {
        deprecationWarning(
            'Route::extensions() is deprecated. ' .
            'Use Route::setExtensions()/getExtensions() instead.'
        );
        if ($extensions === null) {
            return $this->_extensions;
        }
        $this->_extensions = (array)$extensions;
    }
1039318
public function rename($file = NULL, $extension = NULL)
	{
		$target = (!is_null($file) ? $this->filename : $this->extension);
		$replacement = (!is_null($file) ? $file .'.'. $this->extension : $extension);

		$this->file = str_replace($target, $replacement, $this->file);
	}
30037
public static function getSupportedExtensions($extension)
    {
        foreach (static::$_registry as $registered) {
            if (in_array($extension, (array) $registered['extensions'])) {
                return $registered['extensions'];
            }
        }

        throw new ErrorException("The following extension is not handled: {$extension}");
    }
999501
public static function get_icon_for_extension($extension)
    {
        $extension = strtolower($extension);
        $module = ModuleLoader::getModule('silverstripe/framework');

        $candidates = [
            $extension,
            static::get_app_category($extension),
            'generic'
        ];
        foreach ($candidates as $candidate) {
            $resource = $module->getResource("client/images/app_icons/{$candidate}_92.png");
            if ($resource->exists()) {
                return $resource->getURL();
            }
        }
        return null;
    }
586874
protected function getTempFile($extenstion = null)
    {
        $extenstion = is_null($extenstion) ? '' : '.'.$extenstion;
        return tempnam($this->tmp, 'jitim_'.$extenstion);
    }
85182
public function setExtension(string $extension) {
        if(!$this->setModified('extension', $extension)->isModified()) {
            return $this;
        }
		$this->extension = $extension;
		return $this;
    }
964474
private function _getParser($extension)
    {
        $parser = null;
        foreach ($this->_supportedFileParsers as $fileParser) {
            $tempParser = new $fileParser;
            if (in_array($extension, $tempParser->getSupportedExtensions($extension))) {
                $parser = $tempParser;
                continue;
            }
        }
        if ($parser === null) {
            throw new Exception('Unsupported configuration format');
        }

        return $parser;
    }
771588
public function getMimeTypeFromExtension($extension) {
        return isset($this->extensionToMimeType[$extension]) ? $this->extensionToMimeType[$extension] : null;
    }
872214
public function addExtension($extension = null)
    {
        if ($extension == null) {
            return $this->twigEnvironment->addExtension($this->twigDebug());
        }

        return $this->twigEnvironment->addExtension($extension);
    }
806535
public function normalizeExtension($extensions)
    {
        $extensions = explode(',', $extensions);
        array_walk($extensions, function (&$value) {
            $value = '.' . $value;
        });
        return $extensions;
    }
1074636
public function getTypeByExtension($extension)
    {
        if ($this->isValidExtension($extension)) {

            // We get back flipped copy
            $list = $this->getList(true);
            return $list[$extension];

        } else {

            // For all unknown extensions, the default Mime-Type is used
            return 'application/octet-stream';
        }
    }
339474
public function getMimeType($extension)
    {
        if (isset($this->mimeTypes['.'.strtolower($extension)])) {
            return $this->mimeTypes['.'.strtolower($extension)];
        }

        return 'text/plain';
    }
42572
public function toString($indent = null)
    {
        $output = parent::toString($indent);
        $output = str_replace(
            ['<title>', '</title>'], ['<h1>', '</h1>'], $output
        );

        return $output;
    }
694372
public function resetFilters($extension = null)
    {
        if ($extension === null) {
            $this->filters = [];
        }
        else {
            $this->filters[$extension] = [];
        }

        return $this;
    }
1330225
public function extension($extension)
    {
        if (is_string($extension)) {
            $this->extension = ltrim($extension, '.');
        } else {
            $this->extension = null;
        }

        return $this;
    }