|
|
|
|
@ -602,7 +602,14 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common implements IChunkedFil
|
|
|
|
|
|
|
|
|
|
public function moveFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath, ?ICacheEntry $sourceCacheEntry = null): bool {
|
|
|
|
|
$sourceCache = $sourceStorage->getCache();
|
|
|
|
|
if ($sourceStorage->instanceOfStorage(ObjectStoreStorage::class) && $sourceStorage->getObjectStore()->getStorageId() === $this->getObjectStore()->getStorageId()) {
|
|
|
|
|
if (
|
|
|
|
|
$sourceStorage->instanceOfStorage(ObjectStoreStorage::class) &&
|
|
|
|
|
$sourceStorage->getObjectStore()->getStorageId() === $this->getObjectStore()->getStorageId()
|
|
|
|
|
) {
|
|
|
|
|
if ($this->getCache()->get($targetInternalPath)) {
|
|
|
|
|
$this->unlink($targetInternalPath);
|
|
|
|
|
$this->getCache()->remove($targetInternalPath);
|
|
|
|
|
}
|
|
|
|
|
$this->getCache()->moveFromCache($sourceCache, $sourceInternalPath, $targetInternalPath);
|
|
|
|
|
// Do not import any data when source and target bucket are identical.
|
|
|
|
|
return true;
|
|
|
|
|
@ -625,6 +632,10 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common implements IChunkedFil
|
|
|
|
|
/** @var ObjectStoreStorage $sourceStorage */
|
|
|
|
|
$sourceStorage->setPreserveCacheOnDelete(false);
|
|
|
|
|
}
|
|
|
|
|
if ($this->getCache()->get($targetInternalPath)) {
|
|
|
|
|
$this->unlink($targetInternalPath);
|
|
|
|
|
$this->getCache()->remove($targetInternalPath);
|
|
|
|
|
}
|
|
|
|
|
$this->getCache()->moveFromCache($sourceCache, $sourceInternalPath, $targetInternalPath);
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|