listing method

Future<FileInfo?> listing(
  1. String path, {
  2. String pattern = '*',
  3. bool recursive = false,
  4. int? pageSize,
  5. int? offset,
})

Implementation

Future<FileInfo?> listing(String path,
    {String pattern = '*',
    bool recursive = false,
    int? pageSize,
    int? offset}) async {
  if (path.isEmpty) throw ArgumentError.value(ExceptionMessage.emptyPath);
  var methodName = 'files/$path?pattern=$pattern&recursive=$recursive';

  if (pageSize != null) methodName += '&pagesize=$pageSize';

  if (offset != null) methodName += '&offset=$offset';

  return await Invoker.get(methodName);
}