Browse Source
add event for when a direct download is triggered
add event for when a direct download is triggered
Signed-off-by: Robin Appelman <robin@icewind.nl>pull/25563/head
No known key found for this signature in database
GPG Key ID: 42B69D8A64526EFB
9 changed files with 98 additions and 15 deletions
-
5apps/dav/appinfo/v2/direct.php
-
1apps/dav/composer/composer/autoload_classmap.php
-
1apps/dav/composer/composer/autoload_static.php
-
9apps/dav/lib/Direct/DirectFile.php
-
20apps/dav/lib/Direct/DirectHome.php
-
13apps/dav/lib/Direct/ServerFactory.php
-
47apps/dav/lib/Events/BeforeFileDirectDownloadedEvent.php
-
8apps/dav/tests/unit/Direct/DirectFileTest.php
-
9apps/dav/tests/unit/Direct/DirectHomeTest.php
@ -0,0 +1,47 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
/** |
|||
* @copyright Copyright (c) 2021 Robin Appelman <robin@icewind.nl> |
|||
* |
|||
* @license GNU AGPL version 3 or any later version |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License as |
|||
* published by the Free Software Foundation, either version 3 of the |
|||
* License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Affero General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Affero General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
* |
|||
*/ |
|||
|
|||
namespace OCA\DAV\Events; |
|||
|
|||
use OCP\EventDispatcher\Event; |
|||
use OCP\Files\File; |
|||
|
|||
/** |
|||
* @since 22.0.0 |
|||
*/ |
|||
class BeforeFileDirectDownloadedEvent extends Event { |
|||
private $file; |
|||
|
|||
public function __construct(File $file) { |
|||
parent::__construct(); |
|||
$this->file = $file; |
|||
} |
|||
|
|||
/** |
|||
* @return File |
|||
* @since 22.0.0 |
|||
*/ |
|||
public function getFile(): File { |
|||
return $this->file; |
|||
} |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue