<package> new FileServiceManager(logger, netManager, router, binaryConverter, activateCache)
Creates an instance of FileServiceManager.
Parameters:
| Name | Type | Description |
|---|---|---|
logger |
olympe.logging.Channel | |
netManager |
olympe.net.Manager | |
router |
olympe.dc.Router | |
binaryConverter |
olympe.utils.BinaryConverter | |
activateCache |
boolean |
Methods
-
createFile(tag, data, mimeType, onSuccess [, onFailure] [, activateCache])
-
Creates an entry in the file service with the given tag.
Parameters:
Name Type Argument Default Description tagstring The tag of the file.
datastring | Blob | ArrayBuffer | olympe.df.OString Initial content for the file.
mimeTypestring onSuccessfunction Callback to invoke with the file's path if the creation was successful.
onFailurefunction <optional>
Callback to invoke with the error code if the creation failed.
activateCacheboolean <optional>
true Whether the uploaded file content must be put in cache or not
-
deleteFile(file, onSuccess [, onFailure])
-
Deletes a
File.Parameters:
Name Type Argument Description fileolympe.dm.File The file to delete.
onSuccessfunction Callback to invoke if the operation is successful.
onFailurefunction <optional>
Callback to invoke if the operation failed.
-
downloadFile(file, onSuccess [, onFailure] [, activateCache])
-
Downloads the content of a
File.Parameters:
Name Type Argument Default Description fileolympe.dm.File The file to download.
onSuccessfunction Callback to invoke if the operation is successful.
onFailurefunction <optional>
Callback to invoke if the operation failed.
activateCacheboolean <optional>
true Whether the downloaded file content must be put in cache or not
-
uploadFile(file, data, onSuccess [, onFailure] [, activateCache])
-
Updates the content of file with new data.
Parameters:
Name Type Argument Default Description fileolympe.dm.File The file to update.
datastring | Blob | ArrayBuffer | olympe.df.OString New content for that file.
onSuccessfunction Callback to invoke if the operation is successful.
onFailurefunction <optional>
Callback to invoke if the operation failed.
activateCacheboolean <optional>
true Whether the uploaded file content must be put in cache or not
Olympe SDK