RootCollection.php 857 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. public function __construct(
  13. PrincipalBackend\BackendInterface $principalBackend,
  14. string $principalPrefix,
  15. private CleanupService $cleanupService,
  16. ) {
  17. parent::__construct($principalBackend, $principalPrefix);
  18. }
  19. /**
  20. * @inheritdoc
  21. */
  22. public function getChildForPrincipal(array $principalInfo): UploadHome {
  23. return new UploadHome($principalInfo, $this->cleanupService);
  24. }
  25. /**
  26. * @inheritdoc
  27. */
  28. public function getName(): string {
  29. return 'uploads';
  30. }
  31. }