aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/lib/Capabilities.php
blob: 9147e7d9f3aaac8cee661e505e672d83781abc0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php

/**
 * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
 * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
 * SPDX-License-Identifier: AGPL-3.0-only
 */
namespace OCA\Files;

use OCP\Capabilities\ICapability;
use OCP\IConfig;

class Capabilities implements ICapability {

	protected IConfig $config;

	public function __construct(IConfig $config) {
		$this->config = $config;
	}

	/**
	 * Return this classes capabilities
	 *
	 * @return array{files: array{bigfilechunking: bool, blacklisted_files: array<mixed>, forbidden_filename_characters: array<string>}}
	 */
	public function getCapabilities() {
		return [
			'files' => [
				'bigfilechunking' => true,
				'blacklisted_files' => (array)$this->config->getSystemValue('blacklisted_files', ['.htaccess']),
				'forbidden_filename_characters' => \OCP\Util::getForbiddenFileNameChars(),
			],
		];
	}
}