OmhStorageClient

abstract class OmhStorageClient(val authClient: OmhAuthClient)

Constructors

Link copied to clipboard
protected constructor(authClient: OmhAuthClient)

Types

Link copied to clipboard
interface Builder

Properties

Link copied to clipboard
protected val authClient: OmhAuthClient
Link copied to clipboard
abstract val rootFolder: String

The root folder path of the storage service.

Functions

Link copied to clipboard
abstract suspend fun createFileWithExtension(name: String, extension: String, parentId: String): OmhStorageEntity?

This method create file in an specific folder

Link copied to clipboard
abstract suspend fun createFileWithMimeType(name: String, mimeType: String, parentId: String): OmhStorageEntity?

This method create file in an specific folder

Link copied to clipboard
abstract suspend fun createFolder(name: String, parentId: String): OmhStorageEntity?

This method create folder in an specific folder

Link copied to clipboard
abstract suspend fun createPermission(fileId: String, permission: OmhCreatePermission, sendNotificationEmail: Boolean, emailMessage: String?): OmhPermission?

This method update permission role in a given file

Link copied to clipboard
abstract suspend fun deleteFile(id: String)

This method delete files with a given file id

Link copied to clipboard
abstract suspend fun deletePermission(fileId: String, permissionId: String)

This method delete permission with a given permission id in a given file

Link copied to clipboard
abstract suspend fun downloadFile(fileId: String): ByteArrayOutputStream

This method download a file with given id

Link copied to clipboard
abstract suspend fun downloadFileVersion(fileId: String, versionId: String): ByteArrayOutputStream

This method download a file version with a given file id and version id

Link copied to clipboard
abstract suspend fun exportFile(fileId: String, exportedMimeType: String): ByteArrayOutputStream

This method export a provider application file with a given id to a given mimeType

Link copied to clipboard
suspend fun OmhStorageClient.folderSize(folderId: String): Long

Utility method as extension to OmhStorageClient to calculate the total file size of specified folder recursively.

Link copied to clipboard
abstract suspend fun getFileMetadata(fileId: String): OmhStorageMetadata?

This method retrieves the metadata of a given file

Link copied to clipboard
abstract suspend fun getFilePermissions(fileId: String): List<OmhPermission>

This method list permissions to a given file

Link copied to clipboard
abstract suspend fun getFileVersions(fileId: String): List<OmhFileVersion>

This method get the versions of a file with a given file id

Link copied to clipboard
abstract fun getProviderSdk(): Any

This method provides an escape hatch to access the provider native SDK. This allows developers to use the underlying provider's API directly, should they need to access a feature of the provider that is not supported by the OMH plugin. Refer to the plugin's advanced documentation for type to which to cast the instance.

Link copied to clipboard
abstract suspend fun getStorageQuota(): Long

This method returns the storage quota available at the storage provider.

Link copied to clipboard
abstract suspend fun getStorageUsage(): Long

This method returns the total size used at the storage provider.

Link copied to clipboard
abstract suspend fun getWebUrl(fileId: String): String?

This method provides a URL that displays the file in the browse

Link copied to clipboard
abstract suspend fun listFiles(parentId: String = "root"): List<OmhStorageEntity>

This method list files from an specific folder

Link copied to clipboard
abstract suspend fun permanentlyDeleteFile(id: String)

This method permanently delete files with a given file id

Link copied to clipboard
abstract suspend fun search(query: String): List<OmhStorageEntity>

This method list files with a name containing the query value.

Link copied to clipboard
abstract suspend fun updateFile(localFileToUpload: File, fileId: String): OmhStorageEntity?

This method update a remote file with the content of a local file

Link copied to clipboard
abstract suspend fun updatePermission(fileId: String, permissionId: String, role: OmhPermissionRole): OmhPermission?

This method update permission role in a given file

Link copied to clipboard
abstract suspend fun uploadFile(localFileToUpload: File, parentId: String?): OmhStorageEntity?

This method upload a file in an specific folder