@param string      $path
@param string|null $mimeType

@return \Eloquent\Schemer\Value\ValueInterface
555497
public function readPath($path, $mimeType = null)
    {
        return $this->read($this->uriFactory()->fromPath($path), $mimeType);
    }
400997
public function setContent($mimeType, $duration = null)
    {
        self::$xml['content'] = '<media:content';
        $this->setContentMimeType($mimeType);
        $this->setContentDuration($duration);
        self::$xml['content'] .= '>';

        return $this;
    }
767451
public function writePsrStream($path, $stream, $mimeType = null)
    {
        return $this->getFile($path)->write($stream, $mimeType);
    }
658127
public function fromPath($path)
    {
        $mimetype = null;

        if (static::isSupported())
        {
            if (!is_file($path)) {
                throw new \RuntimeException('File not found at '.$path);
            }

            if (!is_readable($path)) {
                throw new \RuntimeException('File not readable at '.$path);
            }

            $mimetype = $this->_getMimetype(strtolower(pathinfo($path, PATHINFO_EXTENSION)));
        }

        return $mimetype;
    }
222943
protected function mimetype($path) {
		$type = '';
		
		if ($this->mimeDetect == 'finfo') {
			$type = @finfo_file($this->finfo, $path); 
		} elseif ($type == 'mime_content_type') {
			$type = mime_content_type($path);
		} else {
			$type = elFinderVolumeDriver::mimetypeInternalDetect($path);
		}
		
		$type = explode(';', $type);
		$type = trim($type[0]);
		
		if ($type == 'application/x-empty') {
			// finfo return this mime for empty files
			$type = 'text/plain';
		} elseif ($type == 'application/x-zip') {
			// http://elrte.org/redmine/issues/163
			$type = 'application/zip';
		}
		
		return $type == 'unknown' && $this->mimeDetect != 'internal'
			? elFinderVolumeDriver::mimetypeInternalDetect($path)
			: $type;
		
	}
906867
public function getMimeType($path)
    {
        $mimeTypes = [
            'png'  => 'image/png',
            'jpe'  => 'image/jpeg',
            'jpeg' => 'image/jpeg',
            'jpg'  => 'image/jpeg',
            'gif'  => 'image/gif',
            'bmp'  => 'image/bmp',
            'ico'  => 'image/vnd.microsoft.icon',
            'tiff' => 'image/tiff',
            'tif'  => 'image/tiff',
            'svg'  => 'image/svg+xml',
            'svgz' => 'image/svg+xml',
        ];

        $ext = pathinfo($path, PATHINFO_EXTENSION);
        if (array_key_exists($ext, $mimeTypes)) {
            return $mimeTypes[$ext];
        }

        return null;
    }
965752
public function update($path, $content, $mimeType = null)
    {
       return $this->getFile($path)->update($content, $mimeType);
    }
605595
public static function getExtension($mimeType)
    {
        if (is_string($mimeType) && in_array($mimeType, self::$mimeTypes, true)) {
            $data = Arrays::setKeysAsValues(self::$mimeTypes, false);

            return $data[$mimeType];
        }

        return '';
    }
430771
public function validate($path, array $mimeTypes = [])
    {
        if (empty($mimeTypes)) {
            $mimeTypes = $this->mimeTypes;
        }

        return in_array(self::getType($path), $mimeTypes);
    }
699723
public static function mimetype(string $path): string
    {
        $result = @finfo_file(finfo_open(FILEINFO_MIME_TYPE), $path);
        return $result !== false ? $result : '';
    }
1143922
public function getMimetype($path)
    {
        $stat = $this->getMetadata($path);

        return isset($stat['custom_headers']['Content-Type'])
            ? ['mimetype' => $stat['custom_headers']['Content-Type']] : false;
    }
1262590
public function updateStream($path, $resource, $mimeType = null)
    {
        return $this->getFile($path)->update($resource, $mimeType);
    }
268546
public function setMimeType($mimeType)
    {
        if ($this->mimeType && $mimeType != $this->mimeType) {
            throw new LogicException('You can only configure a content once');
        }
        $this->mimeType = $mimeType;
        return $this;

    }
32253
public static function guessMimeType($path, $content)
    {
        $mimeType = MimeType::detectByContent($content);

        if ( ! (empty($mimeType) || in_array($mimeType, ['application/x-empty', 'text/plain', 'text/x-asm']))) {
            return $mimeType;
        }

        return MimeType::detectByFilename($path);
    }
76866
public function getConvertedType($mimeType)
    {
        $type = $mimeType;

        if (1 !== preg_match('#^application\/x\.[^/]+\+json$#', $mimeType) && 1 === preg_match('#^[^/]+\/[^/]+$#', $mimeType)) {
            $type = 'content';
        }

        return $type;
    }
727936
public function sendPayload(array $data, $mimeType = null)
    {
        $mimeType = isset($mimeType) ? $mimeType : 'application/json';
        $this->setContentType($mimeType);

        if ($mimeType === 'application/json') {
            $payload = json_encode($data, JSON_PRETTY_PRINT);
        } elseif ($mimeType === 'application/xml') {
            $xml = new \SimpleXMLElement('<?xml version="1.0"?><payload></payload>');
            $this->arrayToXml($data, $xml);
            $payload = $xml->asXML();
        }

        $this->sendHeaders();
        echo $payload;
    }
123527
protected function mimetype($path, $name = '') {
		$type = '';
		
		if ($this->mimeDetect == 'finfo') {
			if ($type = @finfo_file($this->finfo, $path)) {
				if ($name === '') {
					$name = $path;
				}
				$ext = (false === $pos = strrpos($name, '.')) ? '' : substr($name, $pos + 1);
				if ($ext && preg_match('~^application/(?:octet-stream|(?:x-)?zip)~', $type)) {
					if (isset(elFinderVolumeDriver::$mimetypes[$ext])) $type = elFinderVolumeDriver::$mimetypes[$ext];
				}
			}
		} elseif ($type == 'mime_content_type') {
			$type = mime_content_type($path);
		} else {
			$type = elFinderVolumeDriver::mimetypeInternalDetect($path);
		}
		
		$type = explode(';', $type);
		$type = trim($type[0]);

		if (in_array($type, array('application/x-empty', 'inode/x-empty'))) {
			// finfo return this mime for empty files
			$type = 'text/plain';
		} elseif ($type == 'application/x-zip') {
			// http://elrte.org/redmine/issues/163
			$type = 'application/zip';
		}
		
		return $type == 'unknown' && $this->mimeDetect != 'internal'
			? elFinderVolumeDriver::mimetypeInternalDetect($path)
			: $type;
		
	}