The goog.testing.fs.DirectoryEntry Class

goog.testing.fs.DirectoryEntry
> goog.testing.fs.Entry

goog.testing.fs.DirectoryEntry(fs, parent, name, children)

A mock directory entry object.

fs {!goog.testing.fs.FileSystem}
The filesystem containing this entry.
parent {goog.testing.fs.DirectoryEntry}
The directory entry directly containing this entry. If this is null, that means this is the root directory and so is its own parent.
name {string}
The name of this entry.
children {!Object.<!goog.testing.fs.Entry>}
The map of child names to entry objects.

.children {!Object.<!goog.testing.fs.Entry>}

The map of child names to entry objects.

.clone()

returns {!goog.testing.fs.Entry}
A shallow copy of this entry object.

.copyTo(parent, opt_newName)

Inherited from goog.testing.fs.Entry .

parent {!goog.testing.fs.DirectoryEntry}
opt_newName {string=}
returns {!goog.async.Deferred}
@see
{goog.fs.Entry#copyTo}

.createDirectorySync(path)

Creates a directory synchronously. This is a shorthand for getFileSync, useful for setting up tests.

path {string}
The path to the directory, relative to this directory.
returns {!goog.testing.fs.DirectoryEntry}
The created directory.

.createFileSync(path)

Creates a file synchronously. This is a shorthand for getFileSync, useful for setting up tests.

path {string}
The path to the file, relative to this directory.
returns {!goog.testing.fs.FileEntry}
The created file.

.createPath

returns {!goog.async.Deferred}
@see
{goog.fs.DirectoryEntry#createPath}

.deleted {boolean}

Inherited from goog.testing.fs.Entry .

Whether or not this entry has been deleted.

.getDirectory(path, opt_behavior)

path {string}
opt_behavior {goog.fs.DirectoryEntry.Behavior=}
returns {!goog.async.Deferred}
@see
{goog.fs.DirectoryEntry#getDirectory}

.getDirectorySync(path, opt_behavior)

Get a directory synchronously, without waiting for a Deferred to resolve.

path {string}
The path to the directory, relative to this one.
opt_behavior {goog.fs.DirectoryEntry.Behavior=}
The behavior for loading the directory.
returns {!goog.testing.fs.DirectoryEntry}
The loaded directory.

.getFile(path, opt_behavior)

path {string}
opt_behavior {goog.fs.DirectoryEntry.Behavior=}
returns {!goog.async.Deferred}
@see
{goog.fs.DirectoryEntry#getFile}

.getFileSync(path, opt_behavior)

Get a file entry synchronously, without waiting for a Deferred to resolve.

path {string}
The path to the file, relative to this directory.
opt_behavior {goog.fs.DirectoryEntry.Behavior=}
The behavior for loading the file.
returns {!goog.testing.fs.FileEntry}
The loaded file.

.getFileSystem()

Inherited from goog.testing.fs.Entry .

returns {!goog.testing.fs.FileSystem}
@see
{goog.fs.Entry#getFileSystem}

.getFullPath()

Inherited from goog.testing.fs.Entry .

returns {string}
@see
{goog.fs.Entry#getFullPath}

.getLastModified()

returns {!goog.async.Deferred}
@see
{goog.fs.Entry#getLastModified}

.getMetadata()

returns {!goog.async.Deferred}
@see
{goog.fs.Entry#getMetadata}

.getName()

Inherited from goog.testing.fs.Entry .

returns {string}
@see
{goog.fs.Entry#getName}

.getParent()

Inherited from goog.testing.fs.Entry .

returns {!goog.async.Deferred}
@see
{goog.fs.Entry#getParent}

.hasChild(name)

Returns whether this directory has a child with the given name.

name {string}
The name of the entry to check for.
returns {boolean}
Whether or not this has a child with the given name.

.isDirectory()

returns {boolean}
@see
{goog.fs.Entry#isDirectory}

.isFile()

returns {boolean}
@see
{goog.fs.Entry#isFile}

.listDirectory()

returns {!goog.async.Deferred}
@see
{goog.fs.DirectoryEntry#listDirectory}

.moveTo(parent, opt_newName)

Inherited from goog.testing.fs.Entry .

parent {!goog.testing.fs.DirectoryEntry}
opt_newName {string=}
returns {!goog.async.Deferred}
@see
{goog.fs.Entry#moveTo}

.remove()

returns {!goog.async.Deferred}
@see
{goog.fs.Entry#remove}

.removeRecursively()

returns {!goog.async.Deferred}
@see
{goog.fs.DirectoryEntry.removeRecursively}

.toUrl()

Inherited from goog.testing.fs.Entry .

returns {string}
@see
{goog.fs.Entry#toUrl}