The goog.fs Namespace

The goog.fs.DirectoryEntry Class

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}. … more

The goog.fs.Entry Class

The abstract class for entries in the filesystem. … more

The goog.fs.Error Class

A filesystem error. Since the filesystem API is asynchronous, stack traces are less useful for identifying where errors come from, so this includes a large amount of metadata in the message. … more

The goog.fs.FileEntry Class

A file in a local filesystem. This should not be instantiated directly. Instead, it should be accessed via {@link goog.fs.DirectoryEntry#getDirectoryEntry}. … more

The goog.fs.FileReader Class

An object for monitoring the reading of files. This emits ProgressEvents of the types listed in {@link goog.fs.FileReader.EventType}. … more

The goog.fs.FileSaver Class

An object for monitoring the saving of files. This emits ProgressEvents of the types listed in {@link goog.fs.FileSaver.EventType}. This should not be instantiated directly. Instead, its subclass {@link goog.fs.FileWriter} should be accessed via {@link goog.fs.FileEntry#createWriter}. … more

The goog.fs.FileSystem Class

A local filesystem. This shouldn't be instantiated directly. Instead, it should be accessed via {@link goog.fs.getTemporary} or {@link goog.fs.getPersistent}. … more

The goog.fs.FileWriter Class

An object for monitoring the saving of files, as well as other fine-grained writing operations. This should not be instantiated directly. Instead, it should be accessed via {@link goog.fs.FileEntry#createWriter}. … more

The goog.fs.ProgressEvent Class

A wrapper for the progress events emitted by the File APIs. … more

.UrlObject_

@typedef
{!{createObjectURL: (function(!Blob): string), revokeObjectURL: function(string): void}}

.createObjectUrl(blob)

Creates a blob URL for a blob object.

blob {!Blob}
The object for which to create the URL.
returns {string}
The URL for the object.

.getBlob(var_args)

Concatenates one or more values together and converts them to a Blob.

var_args {...(string|!Blob|!ArrayBuffer)}
The values that will make up the resulting blob.
returns {!Blob}
The blob.

.getPersistent(size)

Returns a persistent FileSystem object. A persistent filesystem will never be deleted without the user's or application's authorization.

size {number}
The size requested for the filesystem, in bytes.
returns {!goog.async.Deferred}
The deferred {@link goog.fs.FileSystem}. If an error occurs, the errback is called with a {@link goog.fs.Error}.

.getTemporary(size)

Returns a temporary FileSystem object. A temporary filesystem may be deleted by the user agent at its discretion.

size {number}
The size requested for the filesystem, in bytes.
returns {!goog.async.Deferred}
The deferred {@link goog.fs.FileSystem}. If an error occurs, the errback is called with a {@link goog.fs.Error}.

.revokeObjectUrl(url)

Revokes a URL created by {@link goog.fs.createObjectUrl}.

url {string}
The URL to revoke.

.sliceBlob(blob, start, opt_end)

Slices the blob. The returned blob contains data from the start byte (inclusive) till the end byte (exclusive). Negative indices can be used to count bytes from the end of the blob (-1 == blob.size - 1). Indices are always clamped to blob range. If end is omitted, all the data till the end of the blob is taken.

blob {!Blob}
The blob to be sliced.
start {number}
Index of the starting byte.
opt_end {number=}
Index of the ending byte.
returns {Blob}
The blob slice or null if not supported.