static function GetMimeType($path)
    {
        if (!self::IsReadable($path))
            throw new Exceptions\PathNoAccessException("File $path cannot be read");
        
        $finfo = \finfo_open(FILEINFO_MIME_TYPE);
        $mime = @\finfo_file($finfo, $path);
        if (!$mime)
            throw new \Exception("File info of $path not readable");
        
        return $mime;
    }