setQuota method
Sets the quota resourceLimits for the the user / quotaRoot.
Optionally define the quotaRoot which defaults to "".
Note that the server needs to support the QUOTA capability.
Implementation
Future<QuotaResult> setQuota({
required Map<String, int> resourceLimits,
String quotaRoot = '""',
}) {
final quotaRootParameter =
quotaRoot.contains(' ') ? '"$quotaRoot"' : quotaRoot;
final buffer = StringBuffer()
..write('SETQUOTA ')
..write(quotaRootParameter)
..write(' (')
..write(resourceLimits.entries
.map((entry) => '${entry.key} ${entry.value}')
.join(' '))
..write(')');
final cmd = Command(
buffer.toString(),
writeTimeout: defaultWriteTimeout,
responseTimeout: defaultResponseTimeout,
);
final parser = QuotaParser();
return sendCommand<QuotaResult>(cmd, parser);
}