Class: Environment

Environment

Platform dependant utilities for the openEO JS Client.

Browser implementation, don't use in other environments.

Source:

Methods

(static) base64encode(str) → {string}

Encodes a string into Base64 encoding.

Parameters:
Name Type Description
str string | Buffer

String to encode.

Source:
Returns:

String encoded in Base64.

Type
string

(static) base64encode(str) → {string}

Encodes a string into Base64 encoding.

Parameters:
Name Type Description
str string

String to encode.

Source:
Returns:

String encoded in Base64.

Type
string

(async, static) downloadResults(con, assets, targetFolder)

Downloads files to local storage and returns a list of file paths.

Not supported in Browsers and only throws an Error!

Parameters:
Name Type Description
con Connection
assets Array.<object.<string, *>>
targetFolder string
Source:
Throws:
Error

(async, static) downloadResults(con, assets, targetFolder) → {Promise.<Array.<string>>}

Downloads files to local storage and returns a list of file paths.

Parameters:
Name Type Description
con Connection
assets Array.<object.<string, *>>
targetFolder string
Source:
Throws:
Error
Returns:
Type
Promise.<Array.<string>>

(static) getName() → {string}

Returns the name of the Environment, here Browser.

Source:
Returns:
Type
string

(static) getName() → {string}

Returns the name of the Environment, here Node.

Source:
Returns:
Type
string

(static) getResponseType() → {string}

Returns how binary responses from the servers are returned (stream or blob).

Source:
Returns:
Type
string

(static) getResponseType() → {string}

Returns how binary responses from the servers are returned (stream or blob).

Source:
Returns:
Type
string

(static) getUrl() → {string}

Returns the URL of the server instance.

Source:
Returns:
Type
string

(static) getUrl() → {string}

Returns the current URL of the browser window.

Source:
Returns:
Type
string

(async, static) saveToFile(data, filename) → {Promise.<void>}

Streams data into a file.

Parameters:
Name Type Description
data Stream.Readable

Data stream to read from.

filename string

File path to store the data at.

Source:
Throws:
Error
Returns:
Type
Promise.<void>

(async, static) saveToFile(data, filename) → {Promise.<void>}

Offers data to download in the browser.

This method may fail with overly big data.

Parameters:
Name Type Description
data *

Data to download.

filename string

File name that is suggested to the user.

Source:
See:
Returns:
Type
Promise.<void>

(static) setUrl(uri)

Sets the URL of the server instance.

Parameters:
Name Type Description
uri string
Source:

(static) setUrl(uri)

Sets the URL.

Not supported in Browsers and only throws an Error!

Parameters:
Name Type Description
uri string
Source:

Environment

Platform dependant utilities for the openEO JS Client.

Node.js implementation, don't use in other environments.

Source:

Methods

(static) base64encode(str) → {string}

Encodes a string into Base64 encoding.

Parameters:
Name Type Description
str string | Buffer

String to encode.

Source:
Returns:

String encoded in Base64.

Type
string

(static) base64encode(str) → {string}

Encodes a string into Base64 encoding.

Parameters:
Name Type Description
str string

String to encode.

Source:
Returns:

String encoded in Base64.

Type
string

(async, static) downloadResults(con, assets, targetFolder)

Downloads files to local storage and returns a list of file paths.

Not supported in Browsers and only throws an Error!

Parameters:
Name Type Description
con Connection
assets Array.<object.<string, *>>
targetFolder string
Source:
Throws:
Error

(async, static) downloadResults(con, assets, targetFolder) → {Promise.<Array.<string>>}

Downloads files to local storage and returns a list of file paths.

Parameters:
Name Type Description
con Connection
assets Array.<object.<string, *>>
targetFolder string
Source:
Throws:
Error
Returns:
Type
Promise.<Array.<string>>

(static) getName() → {string}

Returns the name of the Environment, here Browser.

Source:
Returns:
Type
string

(static) getName() → {string}

Returns the name of the Environment, here Node.

Source:
Returns:
Type
string

(static) getResponseType() → {string}

Returns how binary responses from the servers are returned (stream or blob).

Source:
Returns:
Type
string

(static) getResponseType() → {string}

Returns how binary responses from the servers are returned (stream or blob).

Source:
Returns:
Type
string

(static) getUrl() → {string}

Returns the URL of the server instance.

Source:
Returns:
Type
string

(static) getUrl() → {string}

Returns the current URL of the browser window.

Source:
Returns:
Type
string

(async, static) saveToFile(data, filename) → {Promise.<void>}

Streams data into a file.

Parameters:
Name Type Description
data Stream.Readable

Data stream to read from.

filename string

File path to store the data at.

Source:
Throws:
Error
Returns:
Type
Promise.<void>

(async, static) saveToFile(data, filename) → {Promise.<void>}

Offers data to download in the browser.

This method may fail with overly big data.

Parameters:
Name Type Description
data *

Data to download.

filename string

File name that is suggested to the user.

Source:
See:
Returns:
Type
Promise.<void>

(static) setUrl(uri)

Sets the URL of the server instance.

Parameters:
Name Type Description
uri string
Source:

(static) setUrl(uri)

Sets the URL.

Not supported in Browsers and only throws an Error!

Parameters:
Name Type Description
uri string
Source: