Code Duplication    Length = 10-10 lines in 3 locations

lib/private/Files/ObjectStore/ObjectStoreStorage.php 3 locations

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