1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* @copyright Copyright (c) 2018 Robin Appelman <[email protected]> |
4
|
|
|
* |
5
|
|
|
* @license GNU AGPL version 3 or any later version |
6
|
|
|
* |
7
|
|
|
* This program is free software: you can redistribute it and/or modify |
8
|
|
|
* it under the terms of the GNU Affero General Public License as |
9
|
|
|
* published by the Free Software Foundation, either version 3 of the |
10
|
|
|
* License, or (at your option) any later version. |
11
|
|
|
* |
12
|
|
|
* This program is distributed in the hope that it will be useful, |
13
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
14
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15
|
|
|
* GNU Affero General Public License for more details. |
16
|
|
|
* |
17
|
|
|
* You should have received a copy of the GNU Affero General Public License |
18
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
19
|
|
|
* |
20
|
|
|
*/ |
21
|
|
|
|
22
|
|
|
namespace OCA\Files_Trashbin\Sabre; |
23
|
|
|
|
24
|
|
|
use OCP\Files\FileInfo; |
25
|
|
|
|
26
|
|
|
abstract class AbstractTrash implements ITrash { |
27
|
|
|
/** @var FileInfo */ |
28
|
|
|
protected $data; |
29
|
|
|
|
30
|
|
|
public function __construct(FileInfo $data) { |
31
|
|
|
$this->data = $data; |
32
|
|
|
} |
33
|
|
|
|
34
|
|
|
public function getFilename(): string { |
35
|
|
|
return $this->data->getName(); |
36
|
|
|
} |
37
|
|
|
|
38
|
|
|
public function getDeletionTime(): int { |
39
|
|
|
return $this->data->getMtime(); |
40
|
|
|
} |
41
|
|
|
|
42
|
|
|
public function getFileId(): int { |
43
|
|
|
return $this->data->getId(); |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
public function getFileInfo(): FileInfo { |
47
|
|
|
return $this->data; |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
public function getSize(): int { |
51
|
|
|
return $this->data->getSize(); |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
public function getLastModified(): int { |
55
|
|
|
return $this->data->getMtime(); |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
public function getContentType(): string { |
59
|
|
|
return $this->data->getMimetype(); |
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
public function getETag(): string { |
63
|
|
|
return $this->data->getEtag(); |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
public function getName(): string { |
67
|
|
|
return $this->data->getName(); |
68
|
|
|
} |
69
|
|
|
} |
70
|
|
|
|