FileSystemManager.removeSavedFile

Requires:
BaseKit≥2.4.3
Platforms:
iOSAndroid

Method signature
FileSystemManager.removeSavedFile(params: )

Description

Delete a saved local cache file; requires file read/write permissions

Parameters

PropertyTypeRequiredDescription
filePathstringYesPath of the file to delete (local path)
complete() => voidNoCompletion callback (executed on both success and failure)
success() => voidNoCallback on successful API call
fail(params: Object) => voidNoFailure callback
fail callback parameters
PropertyTypeDescription
errorMsgstringError message
errorCodestring | numberError code
Error extension

Return Value

None

Examples

import { getFileSystemManager } from '@ray-js/ray'

// Write a file first to ensure there is a file to delete.
const fm = await getFileSystemManager();

fm.writeFile({
  filePath: "thingfile://usr/ttt_demo.txt",
  data: "hello ttt",
  success: () => {
    fm.removeSavedFile({
      filePath: "thingfile://usr/ttt_demo.txt",
      success: data => {
        console.log(data);
      },
      fail: error => {
        console.error(error);
      },
    });
  },
  fail: error => {
    console.error(error);
  },
});