/** * Validate the importable repo key * * @param importableRemoteRepo Importable repo to validate */ private void validateRepoKey(ImportableRemoteRepo importableRemoteRepo) { // Indicate if the key already exists as any type boolean existsAsLocal = repositoryService.localRepoDescriptorByKey(importableRemoteRepo.getRepoKey()) != null; boolean existsAsRemote = false; if (!existsAsLocal) { existsAsRemote = repositoryService.remoteRepoDescriptorByKey(importableRemoteRepo.getRepoKey()) != null; } boolean existsAsVirtual = false; if (!existsAsLocal && !existsAsRemote) { existsAsVirtual = repositoryService.virtualRepoDescriptorByKey(importableRemoteRepo.getRepoKey()) != null; } importableRemoteRepo.setExistsAsLocal(existsAsLocal); importableRemoteRepo.setExistsAsRemote(existsAsRemote); importableRemoteRepo.setExistsAsVirtual(existsAsVirtual); }