Sets the file path.

@param string $filePath The new file path to use for the example.

@return $this
172754
public function setFilePath($filePath)
    {
        $this->isURI = false;
        $this->filePath = trim($filePath);

        $this->content = null;
        return $this;
    }
1041844
public function setPath($path)
    {
        if (!file_exists($path))
        {
            mkdir($path, 0777, true);
        }

        $this->path = $path;
    }
953140
public function addFilesToRegistry($filePaths)
    {
        collect((array) $filePaths)->each(function ($filePath) {
            if (file_exists($filePath)) {
                AnnotationRegistry::registerFile($filePath);
            }
        });

        return $this;
    }
802292
private function getFilePath($filePath = null)
    {
        $filePath = $filePath ?? $this->filePath ?? null;

        if (null === $filePath) {
            throw NoFilePathGivenException::import();
        }

        return $filePath;
    }
1133176
public function setPath($path = '')
    {
        $userFolder = Str::normalizePath(config('cripfilesys.user_folder'));

        if ($userFolder !== '' && !starts_with($path, $userFolder)) {
            $path = empty($path) ? '' : $path;
            $path = $this->prefixPath($path, $userFolder);
        }

        $this->path = Str::normalizePath($path);

        return $this;
    }
1345505
public function addFile($filepath, $key = 'file')
    {
        $this->options = array_merge_recursive($this->options, [
            'body' => [
                $key => fopen($filepath, 'r'),
            ],
        ]);

        return $this;
    }
1080579
public function loadYamlFile($filePath)
    {
        if (file_exists($filePath)) {
            $this->loadYaml(file_get_contents($filePath));

            return $this;
        }

        return $this;
    }
1257720
public function setRootDir($rootPath = false)
    {
        if (!$rootPath) {
            $this->rootDir = getcwd().DS;
        }

        $this->rootDir = $rootPath.DS;

        return $this;
    }
1199991
protected function init($filepath)
    {
        $this->file = new \SplFileObject($filepath);

        if (!$this->file->isFile()) {
            throw new \LogicException('This is not a file', 1);
        }

        if (!$this->file->isReadable()) {
            throw new \Exception('This file is not readable', 1);
        }

        if (!$this->file->isWritable()) {
            //throw new \Exception("This file is not writable", 1);
        }

        $this->filepath = $this->file->getPathName();
    }
619165
public static function parse(string $filePath): FilePathInterface
    {
        if (!self::myFilePathParse(
            DIRECTORY_SEPARATOR,
            $filePath,
            function ($p, $d, &$e) {
                return self::myPartValidator($p, $d, $e);
            },
            null,
            $isAbsolute,
            $aboveBaseLevel,
            $drive,
            $directoryParts,
            $filename,
            $error)
        ) {
            throw new FilePathInvalidArgumentException('File path "' . $filePath . '" is invalid: ' . $error);
        }

        return new self($isAbsolute, $aboveBaseLevel, $drive, $directoryParts, $filename);
    }
1202991
public function setPath( $path )
	{
#		if( $path && !file_exists( $path ) )
#			throw new RuntimeException( 'Invalid path' );
		$path	= str_replace( DIRECTORY_SEPARATOR, "/", $path );
		$path	= preg_replace( "@(.+)/$@", "\\1", $path )."/";
		$this->path	= $path;
	}
501780
public function setPath($path)
    {
        if(empty($path)) {
            $this->_path = '/';
        } else {
            $this->_path = $path;
        }

        return $this;
    }
257673
public function setDirectory($path) {
        if (substr($path, -1) !== '/') {
            $path .= '/';
        }

        if (!file_exists($path)) {
            mkdir($path, 0777, true);

        } else if (!is_writable($path)) {
            chmod($path, 0777);
        }

        $this->_directory = $path;

        return $this;
    }
796099
protected function createDirectory($filePath)
    {
        $parts = explode('/', $filePath);
        $file = array_pop($parts);
        $dir = '';
        foreach ($parts as $part) {
            if (!is_dir($dir .= "/$part")) {
                mkdir($dir);
            }
        }
    }
94028
public function extract($filePath)
    {
        $directory = $this->directory->getDirectoryPath();
        $zipArchive = new ZipArchive();
        $zipArchive->open($filePath);
        $zipArchive->extractTo($directory);

        return $this->createFinderFromDirectory($directory);
    }
1195736
protected function setTmpName($filepath)
    {
        $this->tmpName = (string) $filepath;

        $this->stream           = null;
        $this->_c_givenResource = $filepath; # stream will made of this when requested
        return $this;
    }
1091302
public function setPath( $path )
    {
        // Validate $path, it cant be null and must exist
        if ( ! is_string( $path ) ){ throw new InvalidPathException( 'Path must be of type string' ); }
        if ( is_null( $path ) ){ throw new InvalidPathException( 'Path can not be null' ); }
        if ( ! file_exists( $path )){ throw new InvalidPathException( '('. $path .') is invalid' ); }

        $this->path = $path;
    }