Code Duplication    Length = 6-7 lines in 2 locations

lib/private/legacy/util.php 2 locations

@@ 1014-1019 (lines=6) @@
1011
	public static function checkDataDirectoryValidity($dataDirectory) {
1012
		$l = \OC::$server->getL10N('lib');
1013
		$errors = [];
1014
		if ($dataDirectory[0] !== '/') {
1015
			$errors[] = [
1016
				'error' => $l->t('Your data directory must be an absolute path'),
1017
				'hint' => $l->t('Check the value of "datadirectory" in your configuration')
1018
			];
1019
		}
1020
		if (!file_exists($dataDirectory . '/.ocdata')) {
1021
			$errors[] = [
1022
				'error' => $l->t('Your data directory is invalid'),
@@ 1020-1026 (lines=7) @@
1017
				'hint' => $l->t('Check the value of "datadirectory" in your configuration')
1018
			];
1019
		}
1020
		if (!file_exists($dataDirectory . '/.ocdata')) {
1021
			$errors[] = [
1022
				'error' => $l->t('Your data directory is invalid'),
1023
				'hint' => $l->t('Ensure there is a file called ".ocdata"' .
1024
					' in the root of the data directory.')
1025
			];
1026
		}
1027
		return $errors;
1028
	}
1029