2015-10-28 09:52:45 -04:00
|
|
|
<?php
|
2019-12-03 13:57:53 -05:00
|
|
|
|
2018-11-02 16:19:27 -04:00
|
|
|
declare(strict_types=1);
|
2019-12-03 13:57:53 -05:00
|
|
|
|
2016-05-26 13:56:05 -04:00
|
|
|
/**
|
2024-05-27 11:39:07 -04:00
|
|
|
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
2016-05-26 13:56:05 -04:00
|
|
|
*/
|
2015-10-28 09:52:45 -04:00
|
|
|
namespace OCA\DAV\Upload;
|
|
|
|
|
|
|
|
|
|
use Sabre\DAVACL\AbstractPrincipalCollection;
|
2018-11-02 16:19:27 -04:00
|
|
|
use Sabre\DAVACL\PrincipalBackend;
|
2015-10-28 09:52:45 -04:00
|
|
|
|
|
|
|
|
class RootCollection extends AbstractPrincipalCollection {
|
|
|
|
|
|
2018-11-02 16:19:27 -04:00
|
|
|
/** @var CleanupService */
|
|
|
|
|
private $cleanupService;
|
|
|
|
|
|
|
|
|
|
public function __construct(PrincipalBackend\BackendInterface $principalBackend,
|
|
|
|
|
string $principalPrefix,
|
|
|
|
|
CleanupService $cleanupService) {
|
|
|
|
|
parent::__construct($principalBackend, $principalPrefix);
|
|
|
|
|
$this->cleanupService = $cleanupService;
|
|
|
|
|
}
|
|
|
|
|
|
2015-10-28 09:52:45 -04:00
|
|
|
/**
|
|
|
|
|
* @inheritdoc
|
|
|
|
|
*/
|
2018-11-02 16:19:27 -04:00
|
|
|
public function getChildForPrincipal(array $principalInfo): UploadHome {
|
|
|
|
|
return new UploadHome($principalInfo, $this->cleanupService);
|
2015-10-28 09:52:45 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @inheritdoc
|
|
|
|
|
*/
|
2018-11-02 16:19:27 -04:00
|
|
|
public function getName(): string {
|
2015-10-28 09:52:45 -04:00
|
|
|
return 'uploads';
|
|
|
|
|
}
|
|
|
|
|
}
|