2020-04-20 16:50:52 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
2020-04-29 05:57:22 -04:00
|
|
|
|
2020-04-20 16:50:52 -04:00
|
|
|
/**
|
2024-05-27 11:39:07 -04:00
|
|
|
* SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
2020-04-20 16:50:52 -04:00
|
|
|
*/
|
|
|
|
|
namespace OCA\DAV\Upload;
|
|
|
|
|
|
|
|
|
|
use OCA\DAV\Connector\Sabre\File;
|
|
|
|
|
use Sabre\DAV\IFile;
|
|
|
|
|
|
|
|
|
|
class UploadFile implements IFile {
|
2024-10-18 06:04:22 -04:00
|
|
|
public function __construct(
|
|
|
|
|
private File $file,
|
|
|
|
|
) {
|
2020-04-20 16:50:52 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function put($data) {
|
|
|
|
|
return $this->file->put($data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function get() {
|
|
|
|
|
return $this->file->get();
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-06 12:26:42 -04:00
|
|
|
public function getId() {
|
|
|
|
|
return $this->file->getId();
|
|
|
|
|
}
|
|
|
|
|
|
2020-04-20 16:50:52 -04:00
|
|
|
public function getContentType() {
|
|
|
|
|
return $this->file->getContentType();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getETag() {
|
|
|
|
|
return $this->file->getETag();
|
|
|
|
|
}
|
|
|
|
|
|
2023-01-23 09:03:56 -05:00
|
|
|
/**
|
2023-01-23 09:43:39 -05:00
|
|
|
* @psalm-suppress ImplementedReturnTypeMismatch \Sabre\DAV\IFile::getSize signature does not support 32bit
|
2023-01-23 09:03:56 -05:00
|
|
|
* @return int|float
|
|
|
|
|
*/
|
2020-04-20 16:50:52 -04:00
|
|
|
public function getSize() {
|
|
|
|
|
return $this->file->getSize();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function delete() {
|
|
|
|
|
$this->file->delete();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getName() {
|
|
|
|
|
return $this->file->getName();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function setName($name) {
|
|
|
|
|
$this->file->setName($name);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getLastModified() {
|
|
|
|
|
return $this->file->getLastModified();
|
|
|
|
|
}
|
2021-05-06 12:26:42 -04:00
|
|
|
|
|
|
|
|
public function getInternalPath(): string {
|
|
|
|
|
return $this->file->getInternalPath();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getFile(): File {
|
|
|
|
|
return $this->file;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getNode() {
|
|
|
|
|
return $this->file->getNode();
|
|
|
|
|
}
|
2020-04-20 16:50:52 -04:00
|
|
|
}
|