2017-08-22 09:44:52 -04:00
|
|
|
<?php
|
2025-06-30 09:04:05 -04:00
|
|
|
|
2017-08-22 09:44:52 -04:00
|
|
|
/**
|
2024-05-23 03:26:56 -04:00
|
|
|
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
2017-08-22 09:44:52 -04:00
|
|
|
*/
|
|
|
|
|
namespace OC\Files\Config;
|
|
|
|
|
|
|
|
|
|
use OCP\Files\Config\ICachedMountFileInfo;
|
|
|
|
|
use OCP\IUser;
|
|
|
|
|
|
|
|
|
|
class CachedMountFileInfo extends CachedMountInfo implements ICachedMountFileInfo {
|
2022-02-10 08:15:07 -05:00
|
|
|
private string $internalPath;
|
2017-08-22 09:44:52 -04:00
|
|
|
|
2022-02-02 10:12:57 -05:00
|
|
|
public function __construct(
|
|
|
|
|
IUser $user,
|
|
|
|
|
int $storageId,
|
|
|
|
|
int $rootId,
|
|
|
|
|
string $mountPoint,
|
|
|
|
|
?int $mountId,
|
|
|
|
|
string $mountProvider,
|
|
|
|
|
string $rootInternalPath,
|
2024-09-19 05:10:31 -04:00
|
|
|
string $internalPath,
|
2022-02-02 10:12:57 -05:00
|
|
|
) {
|
|
|
|
|
parent::__construct($user, $storageId, $rootId, $mountPoint, $mountProvider, $mountId, $rootInternalPath);
|
2017-08-22 09:44:52 -04:00
|
|
|
$this->internalPath = $internalPath;
|
|
|
|
|
}
|
|
|
|
|
|
2022-02-02 10:12:57 -05:00
|
|
|
public function getInternalPath(): string {
|
2017-08-22 09:44:52 -04:00
|
|
|
if ($this->getRootInternalPath()) {
|
|
|
|
|
return substr($this->internalPath, strlen($this->getRootInternalPath()) + 1);
|
|
|
|
|
} else {
|
|
|
|
|
return $this->internalPath;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-02-02 10:12:57 -05:00
|
|
|
public function getPath(): string {
|
2017-08-22 09:44:52 -04:00
|
|
|
return $this->getMountPoint() . $this->getInternalPath();
|
|
|
|
|
}
|
2019-11-22 14:52:10 -05:00
|
|
|
}
|