Accepts paths matching the glob.

@return bool Whether the path is accepted.
970393
public function accept()
    {
        $path = ($this->mode & self::FILTER_VALUE) ? $this->current() : parent::key();

        if (0 !== strpos($path, $this->staticPrefix)) {
            return false;
        }

        $result = (bool) preg_match($this->regExp, $path);

        return $result;
    }
996661
public function valid()
        {
            // Return true if and only if all parts of the URI have passed validation
            return $this->validateUsername()
               && $this->validatePassword()
               && $this->validateHost()
               && $this->validatePort()
               && $this->validatePath()
               && $this->validateQuery()
               && $this->validateFragment();
        }
839532
private function filterExistingPaths(array $globPaths): array
    {
        $existingGlobPaths = [];
        foreach ($globPaths as $globPath) {
            // the final glob is decorated with *, so we need to check it here too
            if (! Strings::endsWith($globPath, '*')) {
                $checkedGlobPath = $globPath . '*';
            } else {
                $checkedGlobPath = $globPath;
            }

            if (glob($checkedGlobPath)) {
                $existingGlobPaths[] = $globPath;
            }
        }

        return $existingGlobPaths;
    }
488353
public static function isAbsolute($path)
    {
        if (empty($path)) {
            return false;
        }

        return $path[0] === '/' ||
            preg_match('/^[A-Z]:\\\\/i', $path) ||
            substr($path, 0, 2) === '\\\\' ||
            self::isRegisteredStreamWrapper($path);
    }
426457
def contains_glob(path, glob_expr):
    '''
    
    '''
    path = os.path.expanduser(path)

    if not os.path.exists(path):
        return False

    try:
        with salt.utils.filebuffer.BufferedReader(path) as breader:
            for chunk in breader:
                if fnmatch.fnmatch(chunk, glob_expr):
                    return True
            return False
    except (IOError, OSError):
        return False
1069593
protected function is_valid_path($path) {
        $rp_substr = substr(realpath($path) . DIRECTORY_SEPARATOR, 0, strlen(realpath($this->path_to_files))) . DIRECTORY_SEPARATOR;
        $rp_files = realpath($this->path_to_files) . DIRECTORY_SEPARATOR;

        // handle better symlinks & network path - issue #448
        $pattern = ['/\\\\+/', '/\/+/'];
        $replacement = ['\\\\', '/'];
        $rp_substr = preg_replace($pattern, $replacement, $rp_substr);
        $rp_files = preg_replace($pattern, $replacement, $rp_files);
        $match = ($rp_substr === $rp_files);

        if (!$match) {
            Log::info('Invalid path "' . $path . '"');
            Log::info('real path: "' . $rp_substr . '"');
            Log::info('path to files: "' . $rp_files . '"');
        }
        return $match;
    }
69857
protected function matchPath($path)
    {
        if (!preg_match_all($this->regex, $path, $matches, \PREG_SET_ORDER)) {
            return false;
        }

        foreach ($matches[0] as $k => $v) {
            if (is_numeric($k)) {
                continue;
            }

            $this->arguments[$k] = $v;
        }

        return true;
    }
1336656
private function createPathIfNeeded()
    {
        if (!is_dir($this->directory)) {
            return @mkdir($this->directory, 0777 & (~$this->umask), true) && !is_dir($this->directory);
        }

        return true;
    }
89666
public function has($path)
    {
        $location = $this->applyPathPrefix($path);

        if ($this->s3Client->doesObjectExist($this->bucket, $location, $this->options)) {
            return true;
        }

        return $this->doesDirectoryExist($location);
    }
506763
public function accept()
    {
        $fileinfo = $this->current();

        foreach ($this->filters as $filter) {
            if (false === $filter($fileinfo)) {
                return false;
            }
        }

        return true;
    }
1073856
public function supportsExif() {
        return $this->_cache(__FUNCTION__, function($file) {
            /** @type \Transit\File $file */

            if (!$file->isImage()) {
                return false;
            }

            return in_array($file->type(), array('image/jpeg', 'image/tiff'));
        });
    }
498473
public function accept()
	{
		$this->numberScanned++;
		if( !preg_match( $this->filePattern, $this->current()->getFilename() ) )
			return FALSE;
		$this->numberFound++;
		if( !$this->contentPattern )
			return TRUE;
		$filePath	= $this->current()->getPathname();
		$realPath	= realpath( $this->current()->getPathname() );
		if( $realPath )
			$filePath	= $realPath;
		$content	= file_get_contents( $filePath );
		$found		= preg_match( $this->contentPattern, $content );
		return $found;
	}
857385
public function isValidLocalPath()
    {
        //====================================================================//
        // Verify no result in Cache
        if (!isset($this->ValidLocalPath)) {
            $path = Splash::getLocalPath();
            //====================================================================//
            // Verify Local Path Exist
            if (is_null($path) || !is_dir($path)) {
                $this->ValidLocalPath = false;

                return Splash::log()->err(Splash::trans('ErrLocalPath', (string) $path));
            }

            $this->ValidLocalPath = true;
        }

        return $this->ValidLocalPath;
    }
897421
public function accept()
    {
        $filename = $this->current()->getRelativePathname();

        if ('\\' === \DIRECTORY_SEPARATOR) {
            $filename = str_replace('\\', '/', $filename);
        }

        return $this->isAccepted($filename);
    }
336207
@Override
    public boolean accept(File pathname) {
        try {
            final boolean filesMatched = super.getFilesMatched();
            final boolean accepted = super.accept(pathname);
            if (accepted && filters != null && FileContentSearch.contains(pathname, filters)) {
                if (!filesMatched) {
                    super.setFilesMatched(filesMatched);
                }
                return false;
            }
            return accepted;
        } catch (IOException ex) {
            LOGGER.warn(String.format("Error testing file %s", pathname), ex);
        }
        return false;
    }
316340
public function
	Accept() {
	/*//
	@override
	//*/

		// provide a way for me to reuse this to accept all files. then
		// i can reuse this is a recursive copy.
		if($this->Exts === null)
		return true;

		// else do the test.
		return array_key_exists(
			$this->getInnerIterator()->getExtension(),
			$this->Exts
		);
	}
315663
public function checkPaths(): self
    {
        if (empty($this->options['rootDir'])) {
            $this->options['rootDir'] .= '/';
        } else {
            $rootDirPosLastChar = strlen($this->options['rootDir']) - 1;
            
            if ($this->options['rootDir'][$rootDirPosLastChar] !== '/') {
                $this->options['rootDir'] .= '/';
            }
        }
        
        if (empty($this->options['vendorDir'])) {
            $this->options['vendorDir'] .= '/';
        } else {
            $vendorDirPosLastChar = strlen($this->options['vendorDir']) - 1;
            
            if ($this->options['vendorDir'][$vendorDirPosLastChar] !== '/') {
                $this->options['vendorDir'] .= '/';
            }
        }
        
        return $this;
    }