BlobEndpoint

Endpoint for a binary blob that can be downloaded or uploaded.

Inheritors

Properties

Link copied to clipboard

Handles errors in responses.

Link copied to clipboard
abstract val httpClient: OkHttpClient

The HTTP client used to communicate with the remote resource.

Link copied to clipboard
abstract val isDeleteAllowed: Boolean?

Indicates whether the server has specified that deleting is currently allowed.

Link copied to clipboard
abstract val isDownloadAllowed: Boolean?

Indicates whether the server has specified that downloading is currently allowed.

Link copied to clipboard
abstract val isUploadAllowed: Boolean?

Indicates whether the server has specified that uploading is currently allowed.

Link copied to clipboard

Extracts links from responses.

Link copied to clipboard
abstract val serializers: List<Serializer>

A list of serializers used for entities received from the server, sorted from most to least preferred. Always uses first for sending to the server.

Link copied to clipboard
abstract val uri: URI

The HTTP URI of the remote resource.

Functions

Link copied to clipboard
abstract fun delete()

Deletes the blob from the server.

Link copied to clipboard
abstract fun download(): InputStream

Downloads the blob's content to an input stream.

open fun download(path: String): Long

Downloads the blob's content to a file.

Link copied to clipboard
abstract fun getLinks(rel: String): List<Pair<URI, String?>>

Resolves all links with a specific relation type. Uses cached data from last response.

Link copied to clipboard
abstract fun link(rel: String): URI

Resolves a single link with a specific relation type. Uses cached data from last response if possible.

Link copied to clipboard
abstract fun linkTemplate(rel: String, variables: Map<String, Any>): URI

Resolves a link template with a specific relation type. Uses cached data from last response if possible.

Link copied to clipboard
abstract fun probe()

Queries the server about capabilities of the endpoint without performing any action.

Link copied to clipboard
abstract fun uploadFrom(stream: InputStream, mimeType: String? = null)

Uploads data as the blob's content from an input stream.

open fun uploadFrom(path: String, mimeType: String? = null)

Uploads content as the blob's content from a file.