Set the path.

@param string $path
@throws \InvalidArgumentException
@return self
499763
public function set($path)
	{
		if (! is_string($path)) {
			throw new \InvalidArgumentException();
		}
		if ($path === '') {
			$this->setParts([]);
		} else {
			$this->setParts(explode('/', $path));
		}
		return $this;
	}
771050
public function setBasePath($path) {
		$path = rtrim($path, '\/');
		
		if (preg_match('~^[a-z]+:~', $path)) {
			$this->basePath = $path;
			$this->isLocal  = false;
			return;
		}
		
		$this->basePath = realpath($path);
		$this->isLocal  = true;
		
		return $this;
	}
478680
public function setOutputPath($path) {
		$dir = pathinfo($path, PATHINFO_DIRNAME);
		$dir = $this->normalizePath($dir);
		
		if (! is_dir($dir)) {
			throw new InvalidPath('Invalid directory: "' . $dir . '"');
		}
		
		if (! is_writable($dir)) {
			throw new InvalidPath('The directory: "' . $dir . '" is unwritable');
		}
		
		if (is_file($path) && ! is_writable($path)) {
			throw new InvalidPath('The File "' . $path . '" exists. but unwritable');
		}
		
		$this->outputFile = $dir . DIRECTORY_SEPARATOR . pathinfo($path, PATHINFO_BASENAME);
		
		return $this;
	}
925251
public function setPath($path)
    {
        $this->path = $path;
        $fileFullPath = "{$this->rootPath}/{$this->path}";
        // readable ?
        if (file_exists($fileFullPath)) {
            $this->file = $fileFullPath;
            return $this;
        }
        // absolute path ?
        if (file_exists($path) && strpos($path, $this->rootPath) === 0) {
            $this->file = $path;
            $this->rootPath = '/';
        } else {
            error_log("[BEAR.Ace] 404: {$fileFullPath}");
            throw new Exception('Not found ' . $fileFullPath, 404);
        }

        return $this;
    }
1011264
public function configDir(string $path): self
    {
        $this->validatePathIsRelativeToProject($path, __METHOD__);
        $this->configDir = rtrim($path, '/');

        return $this;
    }
893700
public function setPath($key, $path)
	{
		$this->paths[(string) $key] = (string) $path;

		return $this;
	}
845004
public function setPath($path)
    {
        if (strlen($path) == 0) {
            throw new \InvalidArgumentException(sprintf('Cloud path should not be empty'));
        }

        $this->path = $path;

        return $this;
    }
1200729
public function setPath($path)
    {
        static $search  = [' ',   '?'];
        static $replace = ['%20', '%3F'];
        $this->path = str_replace($search, $replace, $path);

        return $this;
    }
592385
public function setPath($path)
        {
            if (realpath($path) === false) {
                throw new Exception("Path must be absolute.");
            }

            $this->_path = realpath($path) . DS;
            return $this;
        }
439766
protected function _setCurrentPath($path)
    {
        if ($this->_skipRoot && is_dir($path)) {
            $this->_currentPath = $path.(substr($path, -1)!=DS?DS:'');
        } else {
            $this->_currentPath = dirname($path) . DS;
        }
        return $this;
    }
809395
public function remove_path($path)
	{
		foreach ($this->paths as $i => $p)
		{
			if ($p === $path)
			{
				unset($this->paths[$i]);
				break;
			}
		}

		return $this;
	}
1179098
public function path(string $path) : PathList
    {
        if (!file_exists($path)) {
            throw new \InvalidArgumentException(
                'Arg path doesn\'t exist, path[' . $path . '].'
            );
        }
        if (!is_dir($path)) {
            throw new \InvalidArgumentException(
                'Arg path is not a directory, path[' . $path . '].'
            );
        }
        $this->path = $path;
        return $this;
    }
903800
public function srcDir(string $path): self
    {
        $this->validatePathIsRelativeToProject($path, __METHOD__);
        $this->srcDir = rtrim($path, '/');

        return $this;
    }
62244
protected function setRequestPath($path) {
        // Resolve the path with the base_uri set in the client
        $uri = Psr7\Uri::resolve($this->client->getConfig('base_uri'), Psr7\uri_for($path));
        $this->request = $this->request->withUri($uri);

        return $this;
    }
611385
public function setPath(array $path)
    {
        if (count($path) === 0) {
            $msg = "The path argument must be a non-empty array.";
            throw new InvalidArgumentException($msg);
        } else {
            $this->path = $path;
        }
    }
838205
public function setCachePath($path) {
		$path = rtrim($path, DIRECTORY_SEPARATOR);
		$path = realpath($path);
		
		if ($path === false) {
			throw new NoPath('Invalid path: "' . func_get_arg(0) . '"');
		}
		
		if (! is_dir($path)) {
			throw new NoPath('Path must be a directory: "' . $path . '"');
		}
		
		if (! is_writeable($path)) {
			throw new NoPath('Path must be a writable: "' . $path . '"');
		}
		
		$this->path = $path;
	}
997119
public function setPath(Path $path = null)
    {
        if (!empty($this->path)) {
            $this->path->removeStep($this);
        }

        $this->path = $path;

        if (!empty($path)) {
            $path->addStep($this);
        }

        return $this;
    }