@@ 409-418 (lines=10) @@ | ||
406 | } |
|
407 | ||
408 | /** {@inheritdoc} */ |
|
409 | public function saveVersion($internalPath) { |
|
410 | if ($this->objectStore instanceof IVersionedObjectStorage) { |
|
411 | $stat = $this->stat($internalPath); |
|
412 | // There are cases in the current implementation where saveVersion |
|
413 | // is called before the file was even written. |
|
414 | // There is nothing to be done in this case. |
|
415 | // We return true to not trigger the fallback implementation |
|
416 | if ($stat === false) { |
|
417 | return true; |
|
418 | } |
|
419 | return $this->objectStore->saveVersion($this->getURN($stat['fileid'])); |
|
420 | } |
|
421 | return parent::saveVersion($internalPath); |
|
@@ 461-470 (lines=10) @@ | ||
458 | } |
|
459 | ||
460 | /** {@inheritdoc} */ |
|
461 | public function getContentOfVersion($internalPath, $versionId) { |
|
462 | if ($this->objectStore instanceof IVersionedObjectStorage) { |
|
463 | $stat = $this->stat($internalPath); |
|
464 | if ($stat === false) { |
|
465 | throw new NotFoundException(); |
|
466 | } |
|
467 | return $this->objectStore->getContentOfVersion($this->getURN($stat['fileid']), $versionId); |
|
468 | } |
|
469 | return parent::getContentOfVersion($internalPath, $versionId); |
|
470 | } |
|
471 | ||
472 | /** {@inheritdoc} */ |
|
473 | public function restoreVersion($internalPath, $versionId) { |
|
@@ 473-482 (lines=10) @@ | ||
470 | } |
|
471 | ||
472 | /** {@inheritdoc} */ |
|
473 | public function restoreVersion($internalPath, $versionId) { |
|
474 | if ($this->objectStore instanceof IVersionedObjectStorage) { |
|
475 | $stat = $this->stat($internalPath); |
|
476 | if ($stat === false) { |
|
477 | throw new NotFoundException(); |
|
478 | } |
|
479 | return $this->objectStore->restoreVersion($this->getURN($stat['fileid']), $versionId); |
|
480 | } |
|
481 | return parent::restoreVersion($internalPath, $versionId); |
|
482 | } |
|
483 | ||
484 | /** {@inheritdoc} */ |
|
485 | public function copyFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime = false) { |