$user = $this->userSession->getUser();
$userFolder = $this->rootFolder->getUserFolder($user->getUID());
$file = $userFolder->get($file);
- $versionFile = $this->versionManager->getVersionFile($user, $file, (int)$version);
+ $versionFile = $this->versionManager->getVersionFile($user, $file, $version);
$preview = $this->previewManager->getPreview($versionFile, $x, $y, true, IPreview::MODE_FILL, $versionFile->getMimetype());
return new FileDisplayResponse($preview, Http::STATUS_OK, ['Content-Type' => $preview->getMimeType()]);
} catch (NotFoundException $e) {
/**
* Get the id of the revision for the file
*
- * @return int
+ * @return int|string
* @since 15.0.0
*/
- public function getRevisionId(): int;
+ public function getRevisionId();
/**
* Get the timestamp this version was created
*
* @param IUser $user
* @param FileInfo $sourceFile
- * @param int $revision
+ * @param int|string $revision
* @return ISimpleFile
* @since 15.0.0
*/
- public function getVersionFile(IUser $user, FileInfo $sourceFile, int $revision): File;
+ public function getVersionFile(IUser $user, FileInfo $sourceFile, $revision): File;
}
return $file->fopen('r');
}
- public function getVersionFile(IUser $user, FileInfo $sourceFile, int $revision): File {
+ public function getVersionFile(IUser $user, FileInfo $sourceFile, $revision): File {
$userFolder = $this->rootFolder->getUserFolder($user->getUID());
$versionFolder = $this->getVersionFolder($user);
/** @var File $file */
/** @var int */
private $timestamp;
- /** @var int */
+ /** @var int|string */
private $revisionId;
/** @var string */
public function __construct(
int $timestamp,
- int $revisionId,
+ $revisionId,
string $name,
int $size,
string $mimetype,
return $this->sourceFileInfo;
}
- public function getRevisionId(): int {
+ public function getRevisionId() {
return $this->revisionId;
}
return $backend->read($version);
}
- public function getVersionFile(IUser $user, FileInfo $sourceFile, int $revision): File {
+ public function getVersionFile(IUser $user, FileInfo $sourceFile, $revision): File {
$backend = $this->getBackendForStorage($sourceFile->getStorage());
return $backend->getVersionFile($user, $sourceFile, $revision);
}