move static method

Future<void> move({
  1. required String containerId,
  2. required String fromRelativePath,
  3. required String toRelativePath,
})

Move a file within the iCloud container.

Trailing slashes are allowed for directory paths (from metadata), but both paths must resolve to valid filesystem entries.

Implementation

static Future<void> move({
  required String containerId,
  required String fromRelativePath,
  required String toRelativePath,
}) async {
  if (!_validateRelativePath(fromRelativePath)) {
    throw InvalidArgumentException(
      'invalid relativePath: (from) $fromRelativePath',
    );
  }

  if (!_validateRelativePath(toRelativePath)) {
    throw InvalidArgumentException(
      'invalid relativePath: (to) $toRelativePath',
    );
  }

  await ICloudStoragePlatform.instance.move(
    containerId: containerId,
    fromRelativePath: fromRelativePath,
    toRelativePath: toRelativePath,
  );
}