public function get($path) {
        // TODO: This does not deal with ~ for home directory.

        assert(is_string($path));

        // For ZipArchiveAdapter this is required to get the directories correctly,
        // as Filesystem::get will raise.
        if ($this->filesystem->listContents($path)) {
            return new Directory($this, $path);
        }

        try {
            $info = $this->filesystem->getMetadata($path);
            if ($info) {
                if ($info["type"] == "file") {
                    return new File($this, $path);
                }
                return new Directory($this, $path);
            }
        }
        catch (\League\Flysystem\FileNotFoundException $e) {
            return null;
        }
        return null;
    }