RootCollection.php 941 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
  6. * SPDX-License-Identifier: AGPL-3.0-only
  7. */
  8. namespace OCA\DAV\Upload;
  9. use Sabre\DAVACL\AbstractPrincipalCollection;
  10. use Sabre\DAVACL\PrincipalBackend;
  11. class RootCollection extends AbstractPrincipalCollection {
  12. /** @var CleanupService */
  13. private $cleanupService;
  14. public function __construct(PrincipalBackend\BackendInterface $principalBackend,
  15. string $principalPrefix,
  16. CleanupService $cleanupService) {
  17. parent::__construct($principalBackend, $principalPrefix);
  18. $this->cleanupService = $cleanupService;
  19. }
  20. /**
  21. * @inheritdoc
  22. */
  23. public function getChildForPrincipal(array $principalInfo): UploadHome {
  24. return new UploadHome($principalInfo, $this->cleanupService);
  25. }
  26. /**
  27. * @inheritdoc
  28. */
  29. public function getName(): string {
  30. return 'uploads';
  31. }
  32. }