documentExists static method

Future<bool> documentExists({
  1. required String containerId,
  2. required String relativePath,
})

Check if a file or directory exists without downloading.

Trailing slashes are allowed for directory paths returned by metadata.

Implementation

static Future<bool> documentExists({
  required String containerId,
  required String relativePath,
}) async {
  if (!_validateRelativePath(relativePath)) {
    throw InvalidArgumentException('invalid relativePath: $relativePath');
  }

  return ICloudStoragePlatform.instance.documentExists(
    containerId: containerId,
    relativePath: relativePath,
  );
}