Code Duplication    Length = 15-15 lines in 2 locations

apps/sharebymail/lib/ShareByMailProvider.php 1 location

@@ 950-964 (lines=15) @@
947
	 * @return \OCP\Files\File|\OCP\Files\Folder
948
	 * @throws InvalidShare
949
	 */
950
	private function getNode($userId, $id) {
951
		try {
952
			$userFolder = $this->rootFolder->getUserFolder($userId);
953
		} catch (NoUserException $e) {
954
			throw new InvalidShare();
955
		}
956
957
		$nodes = $userFolder->getById($id);
958
959
		if (empty($nodes)) {
960
			throw new InvalidShare();
961
		}
962
963
		return $nodes[0];
964
	}
965
966
	/**
967
	 * A user is deleted from the system

apps/federatedfilesharing/lib/FederatedShareProvider.php 1 location

@@ 891-905 (lines=15) @@
888
	 * @return \OCP\Files\File|\OCP\Files\Folder
889
	 * @throws InvalidShare
890
	 */
891
	private function getNode($userId, $id) {
892
		try {
893
			$userFolder = $this->rootFolder->getUserFolder($userId);
894
		} catch (NotFoundException $e) {
895
			throw new InvalidShare();
896
		}
897
898
		$nodes = $userFolder->getById($id);
899
900
		if (empty($nodes)) {
901
			throw new InvalidShare();
902
		}
903
904
		return $nodes[0];
905
	}
906
907
	/**
908
	 * A user is deleted from the system