The goog.fs.DirectoryEntry Class

goog.fs.DirectoryEntry
> goog.fs.Entry

goog.fs.DirectoryEntry(fs, dir)

A directory in a local FileSystem. This should not be instantiated directly. Instead, it should be accessed via {@link goog.fs.FileSystem#getRoot} or {@link goog.fs.DirectoryEntry#getDirectoryEntry}.

fs {!goog.fs.FileSystem}
The wrapped filesystem.
dir {!DirectoryEntry}
The underlying DirectoryEntry object.

The goog.fs.DirectoryEntry.Behavior Enum

Behaviors for getting files and directories. … more

.copyTo(parent, opt_newName)

Inherited from goog.fs.Entry .

Copy this entry to a new location.

parent {!goog.fs.DirectoryEntry}
The new parent directory.
opt_newName {string=}
The name of the new entry. If omitted, the new entry has the same name as the original.
returns {!goog.async.Deferred}
The deferred {@link goog.fs.FileEntry} or {@link goog.fs.DirectoryEntry} for the new entry. If an error occurs, the errback is called with a {@link goog.fs.Error}.

.createPath(path)

Opens the directory for the specified path, creating the directory and any intermediate directories as necessary.

path {string}
The directory path to create. May be absolute or relative to the current directory. The parent directory ".." and current directory "." are supported.
returns {!goog.async.Deferred}
A deferred {@link goog.fs.DirectoryEntry} for the requested path. If an error occurs, the errback is called with a {@link goog.fs.Error}.

.getDirectory(path, opt_behavior)

Get a directory within this directory.

path {string}
The path to the directory, relative to this directory.
opt_behavior {goog.fs.DirectoryEntry.Behavior=}
The behavior for handling an existing directory, or the lack thereof.
returns {!goog.async.Deferred}
The deferred {@link goog.fs.DirectoryEntry}. If an error occurs, the errback is called a {@link goog.fs.Error}.

.getFile(path, opt_behavior)

Get a file in the directory.

path {string}
The path to the file, relative to this directory.
opt_behavior {goog.fs.DirectoryEntry.Behavior=}
The behavior for handling an existing file, or the lack thereof.
returns {!goog.async.Deferred}
The deferred {@link goog.fs.FileEntry}. If an error occurs, the errback is called with a {@link goog.fs.Error}.

.getFileSystem()

Inherited from goog.fs.Entry .

returns {!goog.fs.FileSystem}
The filesystem backing this entry.

.getFullPath()

Inherited from goog.fs.Entry .

returns {string}
The full path to this entry.

.getLastModified()

Inherited from goog.fs.Entry .

Retrieves the last modified date for this entry.

returns {!goog.async.Deferred}
The deferred Date for this entry. If an error occurs, the errback is called with a {@link goog.fs.Error}.

.getMetadata()

Inherited from goog.fs.Entry .

Retrieves the metadata for this entry.

returns {!goog.async.Deferred}
The deferred Metadata for this entry. If an error occurs, the errback is called with a {@link goog.fs.Error}.

.getName()

Inherited from goog.fs.Entry .

returns {string}
The name of this entry.

.getParent()

Inherited from goog.fs.Entry .

Gets the parent directory.

returns {!goog.async.Deferred}
The deferred {@link goog.fs.DirectoryEntry}. If an error occurs, the errback is called with a {@link goog.fs.Error}.

.isDirectory()

Inherited from goog.fs.Entry .

returns {boolean}
Whether or not this entry is a directory.

.isFile()

Inherited from goog.fs.Entry .

returns {boolean}
Whether or not this entry is a file.

.listDirectory()

Gets a list of all entries in this directory.

returns {!goog.async.Deferred}
The deferred list of {@link goog.fs.Entry} results. If an error occurs, the errback is called with a {@link goog.fs.Error}.

.moveTo(parent, opt_newName)

Inherited from goog.fs.Entry .

Move this entry to a new location.

parent {!goog.fs.DirectoryEntry}
The new parent directory.
opt_newName {string=}
The new name of the entry. If omitted, the entry retains its original name.
returns {!goog.async.Deferred}
The deferred {@link goog.fs.FileEntry} or {@link goog.fs.DirectoryEntry} for the new entry. If an error occurs, the errback is called with a {@link goog.fs.Error}.

.remove()

Inherited from goog.fs.Entry .

Remove this entry.

returns {!goog.async.Deferred}
A deferred object. If the removal succeeds, the callback is called with true. If an error occurs, the errback is called a {@link goog.fs.Error}.

.removeRecursively()

Removes this directory and all its contents.

returns {!goog.async.Deferred}
A deferred object. If the removal succeeds, the callback is called with true. If an error occurs, the errback is called a {@link goog.fs.Error}.

.toUrl(opt_mimeType)

Inherited from goog.fs.Entry .

Get the URL for this file.

opt_mimeType {string=}
The MIME type that will be served for the URL.
returns {string}
The URL.