Get an object in this tree.

@param string $path The path to an object in the tree.

@return Blob|Tree|false
A Blob or Tree object, or false if the object does not exist.
327041
public function getObject($path)
    {
        if ($path === '' || $path === '.') {
            return $this;
        }
        $data = $this->getObjectData($path);
        if ($data === false) {
            return false;
        }

        if ($data['type'] === 'blob') {
            return Blob::fromSha($data['sha'], $this->getUri(), $this->client);
        } elseif ($data['type'] === 'tree') {
            return Tree::fromSha($data['sha'], $this->getUri(), $this->client);
        }

        throw new \RuntimeException('Unrecognised object type: ' . $data['type']);
    }
1351941
public function read($path)
    {
        $response = $this->readObject($path);

        if ($response !== false) {
            $response['contents'] = $response['contents']->getContents();
        }

        return $response;
    }
718992
public function cd($path)
    {
        $path = $this->realpath($path);
        if ($path !== false && is_dir($path)) {
            return $this->path = $path;
        }

        return false;
    }
819925
public function getByPath($path)
    {
        $extension = pathinfo($path, PATHINFO_EXTENSION);
        if ('' === $extension) {
            $extension = null;
        }

        return $this->get($extension);
    }
58031
protected function getPath($path)
	{
		$paths = array();

		// If `$path` is an array
		if (is_array($path))
		{
			foreach ($path as $unverifiedPath)
			{
				$paths = array_merge($paths, $this->getPath($unverifiedPath));
			}

			return $paths;
		}

		// If `$path` is a directory
		if (is_dir($path))
		{
			$paths = glob($path . '/*.*');

			return $paths;
		}

		// If `$path` is a file
		if (file_exists($path))
		{
			$paths[] = $path;
		}

		return $paths;
	}
1124704
protected function relativeJoomlaTargetPath($path)
    {
        if (strpos($path, JPATH_ROOT) === 0) {
            return substr($path, strlen(JPATH_ROOT) + 1);
        }

        return $path;
    }
879734
public function findByPath(string $path)
    {
        return $this->first(function(ExtensionContract $extension) use($path) {
                    return $extension->getPath() === $path;
                });
    }
1347964
public static function decodeFromFile($path)
    {
        if (!file_exists($path)) {
            throw new \RuntimeException("File $path does not exist");
        }

        $buffer = file_get_contents($path);
        $object = self::decode($buffer);

        return $object;
    }
1003941
public function read($path)
    {
        $path = $this->applyPathPrefix($path);

        $object = $this->bucket->object($path);

        $contents = $object->downloadAsString();

        return compact('path', 'contents');
    }
22415
public function getUrl($path)
    {
        if ($this->publish($path)) {
            $obj = $this->getFileObject($path);
            if ($url = $obj->getWebContentLink()) {
                return str_replace('export=download', 'export=media', $url);
            }
            if ($url = $obj->getWebViewLink()) {
                return $url;
            }
        }
        return false;
    }
1074315
public function getUrl($path) {
        $mapping = $this->mapper->get($path);

        if (!$mapping) {
            return false;
        }

        try {
            $volume = $this->client->lookup($mapping['fid']);

            return $this->client->buildVolumeUrl($volume->getPublicUrl(), $mapping['fid']);
        } catch (SeaweedFSException $e) {
            return false;
        }
    }
243609
public function isLast($path)
    {
        return $this->items && $path === array_keys($this->items)[\count($this->items) - 1];
    }
255878
public function pathToEntity($path)
    {
        return is_dir($path) ? new FileSystem\Directory($path) : new FileSystem\File($path);
    }
75604
public function get($path)
    {
        $parts = explode('.', $path);
        switch (count($parts)) {
            case 2:
                if (isset($this->_data[$parts[0]][$parts[1]])) {
                    return $this->_data[$parts[0]][$parts[1]];
                }
                break;
            case 1:
                if (isset($this->_data[$parts[0]])) {
                    return $this->_data[$parts[0]];
                }
                break;
            case 0:
                throw new RuntimeException('Path was empty.');
            default:
                throw new RuntimeException('Too many parts in path.');
        }
    }
687416
public function read($path)
    {
        $this->assertPresent($path);
        $path = Util::normalizePath($path);
        if (!($object = $this->adapter->read($path))) {
            return false;
        }

        return $object['contents'];
    }
1013985
public function getNodeForPath($path)
    {
        $path = trim($path, '/');
        if (isset($this->cache[$path])) {
            return $this->cache[$path];
        }

        // Is it the root node?
        if (!strlen($path)) {
            return $this->rootNode;
        }

        // Attempting to fetch its parent
        list($parentName, $baseName) = Uri\split($path);

        // If there was no parent, we must simply ask it from the root node.
        if ('' === $parentName) {
            $node = $this->rootNode->getChild($baseName);
        } else {
            // Otherwise, we recursively grab the parent and ask him/her.
            $parent = $this->getNodeForPath($parentName);

            if (!($parent instanceof ICollection)) {
                throw new Exception\NotFound('Could not find node at path: '.$path);
            }
            $node = $parent->getChild($baseName);
        }

        $this->cache[$path] = $node;

        return $node;
    }
74615
public function getChild($path)
    {
        if (is_string($path)) {
            $path = explode('/', $path);
        }
        $remaining = array_splice($path, 1, count($path) - 1);

        foreach ($this->childItems as $childItem) {
            if ($childItem->getId() == $path[0]) {
                if (empty($remaining)) {
                    return $childItem;
                } elseif ($childItem instanceof ParentItem) {
                    return $childItem->getChild($remaining);
                } else {
                    return null;
                }
            }
        }

        return null;
    }