@param string $path

@return self
774172
public static function fromUnWritableFile($path)
    {
        if (! file_exists(dirname($path))) {
            return new self(
                sprintf('Invalid path provided, the path "%s" does not seem to have a parent directory', $path)
            );
        }

        if (is_dir($path)) {
            return new self(
                sprintf('The provided path "%s" is a directory, and it cannot be written as a file', $path)
            );
        }

        return new self(sprintf('The provided path "%s" is invalid', $path));
    }
987667
public function prepend($path)
    {
        if (!is_array($path)) {
            $path = $this->normalize($path);
        }

        $path = array_merge($path, $this->paths);

        $this->paths = $this->removeDots($path);

        return $this;
    }
109035
public function setPath(string $path)
    {
        $path = '/' . ltrim($path, '/');
        $this->query = null;
        $this->fragment = null;
        if (preg_match('/^(.*?)(\\?([^#]*))?(#(.*))?$/u', $path, $matches))
        {
            $path = $matches[1];
            $this->query = !empty($matches[3]) ? $matches[3] : null;
            $this->fragment = !empty($matches[5]) ? $matches[5] : null;
        }

        $this->path = $path;
        return $this;
    }
1029897
public function withPath($path)
    {
        // if the path is absolute, then clear basePath
        if (substr($path, 0, 1) == '/') {
            $clone->basePath = '';
        }
        $this->path = $this->filterQuery($path);

        return $this;
    }
1009361
public function extract($path)
	{
		$data = $this->get($path);

		if (is_null($data))
		{
			return null;
		}

		return new self($data);
	}
236747
public function remove($path)
    {
        StructureHelper::removeByPath($this->data, $path, $this->separator);

        return $this;
    }
1142910
public function isActiveWhen($path)
    {
        // Remove unwanted chars
        $path = ltrim($path, '/');
        $path = rtrim($path, '/');
        $path = rtrim($path, '?');

        $this->activeWhen = $path;

        return $this;
    }
55281
private function createFromEncrypted(string $path): self
    {
        /** @var resource $imageData */
        $imageData = file_get_contents($path);
        $this->workingData = $imageData;
        $this->encrypted = true;
        return $this;
    }
276262
public function save($path)
    {
        if ( ! file_exists( $this->getCropsFolder( $path ) ) ) {
            $this->handler->save( $this->getCropsFolder( $path ), true );
        }

        return $this;
    }
305532
public function setFilePath($path) {
		$path = realpath($path);
		
		if ($path === false) {
			throw new NoPath('Invalid path: ' . $path);
		}
		
		$this->path = $path;
		
		return $this;
	}
418195
public function save($path)
    {
        $this->validate();
        $path = rtrim($path, "\\/") . DS;
        $this->_savePackage($path);
        return $this;
    }
729366
public function withPath(string $path): self
    {
        $newConstraints = $this->constraints;
        $newConstraints[self::CONSTRAINT_PATH] = $path;
        return new static($newConstraints);
    }
8612
public function reset($path = '') {
        clearstatcache();

        $this->_cache = array();

        if ($path) {
            $this->_data['name'] = basename($path);
            $this->_path = $path;
        }

        return $this;
    }
409739
public function remove($path)
    {
        $key = $this->getCacheKey($path);

        unset($this->data[$key]);

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

        return $this;
    }
809395
public function remove_path($path)
	{
		foreach ($this->paths as $i => $p)
		{
			if ($p === $path)
			{
				unset($this->paths[$i]);
				break;
			}
		}

		return $this;
	}
126111
protected function createDirectory($path)
    {
        if (!File::isDirectory($path)) {
            File::makeDirectory($path, 0777, true, true);
        }

        return $this;
    }