Class JsFileContents
java.lang.Object
io.deephaven.web.client.api.storage.JsFileContents
Represents a file's contents loaded from the server. If an etag was specified when loading, client should first test
if the etag of this instance matches - if so, the contents will be empty, and the client's existing contents should
be used.
-
Constructor Summary
ConstructorsConstructorDescriptionJsFileContents(elemental2.dom.Blob data, String etag) JsFileContents(String etag) -
Method Summary
Modifier and TypeMethodDescriptionelemental2.promise.Promise<elemental2.core.ArrayBuffer> Reads the contents as an ArrayBuffer.static JsFileContentsarrayBuffers(elemental2.core.ArrayBuffer... buffers) Creates an instance from one or more ArrayBuffer values.static JsFileContentsblob(elemental2.dom.Blob blob) Creates an instance from an existing Blob.getEtag()The etag associated with the contents.elemental2.promise.Promise<String> text()Reads the contents as text.static JsFileContentsCreates an instance from text.
-
Constructor Details
-
JsFileContents
-
JsFileContents
-
-
Method Details
-
blob
Creates an instance from an existing Blob.- Parameters:
blob- The blob containing the file contents.- Returns:
- A
JsFileContentsinstance containing the provided data.
-
text
Creates an instance from text.- Parameters:
text- One or more string parts to combine into a Blob.- Returns:
- A
JsFileContentsinstance containing the provided data.
-
arrayBuffers
Creates an instance from one or more ArrayBuffer values.- Parameters:
buffers- One or more buffers to combine into a Blob.- Returns:
- A
JsFileContentsinstance containing the provided data.
-
text
Reads the contents as text.- Returns:
- A promise that resolves to the file contents as a string.
-
arrayBuffer
@JsMethod public elemental2.promise.Promise<elemental2.core.ArrayBuffer> arrayBuffer()Reads the contents as an ArrayBuffer.- Returns:
- A promise that resolves to the file contents as an
ArrayBuffer.
-
getEtag
The etag associated with the contents.If an etag was provided when loading and the server indicates that the client's cached contents are still valid, the contents of this instance may be empty and only the etag will be returned.
-