testing.fs.DirectoryEntry Extends goog.testing.fs.Entry
A mock directory entry object.

Inheritance

Constructor

goog.testing.fs.DirectoryEntry(fsparentnamechildren)

Parameters

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.

Instance Methods

Public Protected Private
clone()
No description.
code »
createDirectorySync(path) !goog.testing.fs.DirectoryEntry
Creates a directory synchronously. This is a shorthand for getFileSync, useful for setting up tests.
Arguments:
path : string
The path to the directory, relative to this directory.
Returns: !goog.testing.fs.DirectoryEntry  The created directory.
code »
createFileSync(path) !goog.testing.fs.FileEntry
Creates a file synchronously. This is a shorthand for getFileSync, useful for setting up tests.
Arguments:
path : string
The path to the file, relative to this directory.
Returns: !goog.testing.fs.FileEntry  The created file.
code »
getDirectory()
No description.
code »
getDirectorySync(pathopt_behavior) !goog.testing.fs.DirectoryEntry
Get a directory synchronously, without waiting for a Deferred to resolve.
Arguments:
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.
code »
getEntry_(pathbehaviorisFilecreateFn) !goog.testing.fs.Entry
Get a file or directory entry from a path. This handles parsing the path for subdirectories and throwing appropriate errors should something go wrong.
Arguments:
path : string
The path to the entry, relative to this directory.
behavior : goog.fs.DirectoryEntry.Behavior
The behavior for loading the entry.
isFile : boolean
Whether a file or directory is being loaded.
createFn : function(!goog.testing.fs.DirectoryEntry, string) : !goog.testing.fs.Entry
The function for creating the entry if it doesn't yet exist. This is passed the parent entry and the name of the new entry.
Returns: !goog.testing.fs.Entry  The loaded entry.
code »
getFile()
No description.
code »
getFileSync(pathopt_behavioropt_dataopt_type) !goog.testing.fs.FileEntry
Get a file entry synchronously, without waiting for a Deferred to resolve.
Arguments:
path : string
The path to the file, relative to this directory.
opt_behavior : goog.fs.DirectoryEntry.Behavior=
The behavior for loading the file.
opt_data : string=
The string data encapsulated by the blob.
opt_type : string=
The mime type of the blob.
Returns: !goog.testing.fs.FileEntry  The loaded file.
code »
getLastModified()
No description.
code »
getMetadata()
No description.
code »
getMetadata_() {modificationTime: Date
Constructs and returns the metadata object for this entry.
Returns: {modificationTime: Date  } The metadata object.
code »
hasChild(name) boolean
Returns whether this directory has a child with the given name.
Arguments:
name : string
The name of the entry to check for.
Returns: boolean  Whether or not this has a child with the given name.
code »
isDirectory()
No description.
code »
isFile()
No description.
code »
listDirectory()
No description.
code »
remove()
No description.
code »
removeRecursively()
No description.
code »
checkNotDeleted(action) !goog.async.Deferred
Return a deferred that will call its errback if this entry has been deleted. In addition, the deferred will only run after a timeout of 0, and all its callbacks will run with the entry as "this".
Arguments:
action : string
The name of the action being performed. For error reporting.
Returns: !goog.async.Deferred  The deferred that will be called after a timeout of 0.
code »
clone() !goog.testing.fs.Entry
No description.
Returns: !goog.testing.fs.Entry  A shallow copy of this entry object.
code »
copyTo()
No description.
code »
getFileSystem() !goog.testing.fs.FileSystem
No description.
Returns: !goog.testing.fs.FileSystem  No description.
code »
getFullPath()
No description.
code »
getName()
No description.
code »
getParent()
No description.
code »
moveTo()
No description.
code »
remove()
No description.
code »
toUri()
No description.
code »
toUrl()
No description.
code »

Instance Properties

children :
The map of child names to entry objects.
Code »
constructor :
No description.
Code »
createPath :
No description.
Code »
lastModifiedTimestamp_ :
The modification time of the directory. Measured using goog.now, which may be overridden with mock time providers.
Code »
deleted :
Whether or not this entry has been deleted.
Code »
This entry's filesystem.
Code »
getLastModified :
No description.
Code »
getMetadata :
No description.
Code »
isDirectory :
No description.
Code »
isFile :
No description.
Code »
name_ :
The name of this entry.
Code »
The parent of this entry.
Code »
wrapEntry :
No description.
Code »

Static Properties

goog.testing.fs.DirectoryEntry.superClass_ :
No description.
Code »

Package testing.fs

Package Reference