Code Duplication    Length = 6-7 lines in 2 locations

lib/private/legacy/util.php 2 locations

@@ 991-996 (lines=6) @@
988
	public static function checkDataDirectoryValidity($dataDirectory) {
989
		$l = \OC::$server->getL10N('lib');
990
		$errors = [];
991
		if ($dataDirectory[0] !== '/') {
992
			$errors[] = [
993
				'error' => $l->t('Your Data directory must be an absolute path'),
994
				'hint' => $l->t('Check the value of "datadirectory" in your configuration')
995
			];
996
		}
997
		if (!file_exists($dataDirectory . '/.ocdata')) {
998
			$errors[] = [
999
				'error' => $l->t('Your Data directory  is invalid'),
@@ 997-1003 (lines=7) @@
994
				'hint' => $l->t('Check the value of "datadirectory" in your configuration')
995
			];
996
		}
997
		if (!file_exists($dataDirectory . '/.ocdata')) {
998
			$errors[] = [
999
				'error' => $l->t('Your Data directory  is invalid'),
1000
				'hint' => $l->t('Please check that the data directory contains a file' .
1001
					' ".ocdata" in its root.')
1002
			];
1003
		}
1004
		return $errors;
1005
	}
1006