setName('groupfolders:quota')
->setDescription('Edit the quota of a configured Team folder')
->addArgument('folder_id', InputArgument::REQUIRED, 'Id of the folder to configure')
->addArgument('quota', InputArgument::REQUIRED, 'New value for the quota of the folder');
parent::configure();
}
protected function execute(InputInterface $input, OutputInterface $output): int {
$folder = $this->getFolder($input, $output);
if ($folder === null) {
return -1;
}
$quotaString = $input->getArgument('quota');
if (!is_string($quotaString)) {
$output->writeln(' argument has to be a string');
return -3;
}
$quotaString = strtolower($quotaString);
$quota = ($quotaString === 'unlimited') ? FileInfo::SPACE_UNLIMITED : \OCP\Util::computerFileSize($quotaString);
if ($quota) {
$this->folderManager->setFolderQuota($folder->id, (int)$quota);
return 0;
}
$output->writeln('Unable to parse quota input: ' . $quotaString . '');
return -1;
}
}