**********************************
Access to TeamRepository methods *
**********************************
351102
public function getWidgetDisplayConfigsByUserAndWidgets(
        User $user,
        array $widgetInstances,
        $executeQuery = true
    )
    {
        return count($widgetInstances) > 0 ?
            $this->widgetDisplayConfigRepo->findWidgetDisplayConfigsByUserAndWidgets(
                $user,
                $widgetInstances,
                $executeQuery
            ) :
            array();
    }
760629
private boolean isAccessGranted(ScoreNode[] nodes) throws RepositoryException
   {
      if (isSystemSession)
      {
         return true;
      }
      for (int i = 0; i < nodes.length; i++)
      {
         try
         {
            //if (nodes[i] != null && !accessMgr.isGranted(nodes[i].getNodeId(), PermissionType.READ)) {
            if (nodes[i] != null)
            {
               NodeData nodeData = (NodeData)itemMgr.getItemData(nodes[i].getNodeId());
               if (nodeData == null
                  || !accessMgr.hasPermission(nodeData.getACL(), PermissionType.READ, session.getUserState()
                     .getIdentity()))
               {
                  return false;
               }
            }
         }
         catch (ItemNotFoundException e)
         {
            if (LOG.isTraceEnabled())
            {
               LOG.trace("An exception occurred: " + e.getMessage());
            }
         }
      }
      return true;
   }
61274
public final void loadRepository(ClassLoader classLoader, String repositoryPackage, String repositoryName){
        try{
            Class repositoryClass = classLoader.loadClass(repositoryPackage + "." + repositoryName);
            Repository<T> instance = (Repository<T>) repositoryClass.newInstance();
            generatedMap.putAll(instance.get());

        } catch (ClassNotFoundException e) {
            //nothing
        } catch (InstantiationException e) {
            throw new TransfuseRuntimeException("Unable to instantiate generated Repository", e);
        } catch (IllegalAccessException e) {
            throw new TransfuseRuntimeException("Unable to access generated Repository", e);
        }
    }
1115654
public void addRepository(UpdateRepository newRepo) {
        for (UpdateRepository ur : repositories) {
            if (ur.getId().equals(newRepo.getId())) {
                throw new RuntimeException("Repository with id " + newRepo.getId() + " already exists");
            }
        }
        newRepo.refresh();
        repositories.add(newRepo);
    }
1266174
private RepositoryId getRepository(final String owner, final String name) throws GitHubException {
		RepositoryId repository = null;
		if(StringUtils.isNotBlank(name) && StringUtils.isNotBlank(owner)){
			repository = RepositoryId.create(owner, name);
		}else{
			throw new GitHubException("No GitHub repository (owner and name) configured");
		}
		if (log.isDebugEnabled()){
			log.debug(MessageFormat.format("Using GitHub repository {0}", repository.generateId()));
		}
		return repository;
	}
195843
protected RepositoryId getRepository(final MavenProject project,
			final String owner, final String name)
			throws MojoExecutionException {
		RepositoryId repository = RepositoryUtils.getRepository(project, owner,
				name);
		if (repository == null)
			throw new MojoExecutionException(
					"No GitHub repository (owner and name) configured");
		if (isDebug())
			debug(MessageFormat.format("Using GitHub repository {0}",
					repository.generateId()));
		return repository;
	}
1374022
@Override
    public Collection<Throwable> restoreRepository(final FedoraSession session,
                                      final File backupDirectory) {
        final Session jcrSession = getJcrSession(session);
        try {
            final RepositoryManager repoMgr = ((org.modeshape.jcr.api.Session) jcrSession)
                    .getWorkspace()
                    .getRepositoryManager();

            final Collection<Throwable> problems = new ArrayList<>();

            repoMgr.restoreRepository(backupDirectory).forEach(x -> problems.add(x.getThrowable()));

            return problems;
        } catch (final RepositoryException e) {
            throw new RepositoryRuntimeException(e);
        }
    }
294901
@Override
    public void checkRepositoryStatus() throws IOException {
        if (!exists(null)) {
            throw new FileNotFoundException("Could not find " + _root);
        }
        if (!hasChildren(null)) {
            throw new IOException("The root (" + _root + " is not a directory ");
        }
    }
195243
@Post("/projects/{projectName}/repos")
    @StatusCode(201)
    @ResponseConverter(CreateApiResponseConverter.class)
    @RequiresRole(roles = ProjectRole.OWNER)
    public CompletableFuture<RepositoryDto> createRepository(ServiceRequestContext ctx, Project project,
                                                             CreateRepositoryRequest request,
                                                             Author author) {
        if (Project.isReservedRepoName(request.name())) {
            return HttpApiUtil.throwResponse(ctx, HttpStatus.FORBIDDEN,
                                             "A reserved repository cannot be created.");
        }
        return execute(Command.createRepository(author, project.name(), request.name()))
                .thenCompose(unused -> mds.addRepo(author, project.name(), request.name()))
                .handle(returnOrThrow(() -> DtoConverter.convert(project.repos().get(request.name()))));
    }
664735
public Response restoreRepository( ServletContext context, 
                                       HttpServletRequest request, 
                                       String repositoryName,
                                       String backupName, 
                                       RestoreOptions options ) throws RepositoryException {
        if (StringUtil.isBlank(backupName)) {
            throw new IllegalArgumentException("The name of the backup cannot be null");
        }
        File backup = resolveBackup(context, backupName);
        logger.debug("Restoring repository '{0}' from backup '{1}' using '{2}'", repositoryName, backup, options);
        Session session = getSession(request, repositoryName, null);
        RepositoryManager repositoryManager = ((org.modeshape.jcr.api.Workspace)session.getWorkspace()).getRepositoryManager();
        final Problems problems = repositoryManager.restoreRepository(backup, options);
        if (!problems.hasProblems()) {
            return Response.ok().build();
        }
        List<JSONAble> response = new ArrayList<JSONAble>(problems.size());
        for (Problem problem : problems) {
            RestException exception = problem.getThrowable() != null ? 
                                      new RestException(problem.getMessage(), problem.getThrowable()) : 
                                      new RestException(problem.getMessage());
            response.add(exception);
        }
        return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(response).build();
    }
52872
function getCustomRepository(RepositoryClass, knex, entityModel) {
  validate.inheritsFrom(
    RepositoryClass,
    EntityRepository,
    'Custom repository class must inherit from EntityRepository'
  );
  return memoizedGetCustomRepository(...arguments);
}
1315571
protected ManageableRepository getWorkingRepository() throws RepositoryException, RepositoryConfigurationException
   {
      return repositoryName != null ? repositoryService.getRepository(repositoryName) : repositoryService
         .getCurrentRepository();
   }
169688
protected void configureAop() {
        final RepositoryMethodInterceptor proxy = new RepositoryMethodInterceptor();
        requestInjection(proxy);
        // repository specific method annotations (query, function, delegate, etc.)
        bindInterceptor(Matchers.any(), new AbstractMatcher<Method>() {
            @Override
            public boolean matches(final Method method) {
                // this will throw error if two or more annotations specified (fail fast)
                try {
                    return ExtUtils.findMethodAnnotation(method) != null;
                } catch (Exception ex) {
                    throw new MethodDefinitionException(String.format("Error declaration on method %s",
                            RepositoryUtils.methodToString(method)), ex);
                }
            }
        }, proxy);
    }
946707
public void setRepositories(java.util.Collection<RepositoryNameIdPair> repositories) {
        if (repositories == null) {
            this.repositories = null;
            return;
        }

        this.repositories = new java.util.ArrayList<RepositoryNameIdPair>(repositories);
    }
988177
@SuppressWarnings("unchecked")
    void fetchFromRepository(Collection<ProductDefinition> installDefinition) throws RepositoryException {
        Collection<ResourceType> interestingTypes = new HashSet<ResourceType>();
        interestingTypes.add(ResourceType.FEATURE);
        interestingTypes.add(ResourceType.OPENSOURCE);
        interestingTypes.add(ResourceType.PRODUCTSAMPLE);
        Map<ResourceType, Collection<? extends RepositoryResource>> resources = repoConnections.getResources(installDefinition, interestingTypes, null);

        Collection<EsaResource> features = (Collection<EsaResource>) resources.get(ResourceType.FEATURE);
        if (features != null) {
            repoFeatures = features;
        } else {
            repoFeatures = Collections.emptySet();
        }

        repoSamples = new ArrayList<>();
        Collection<SampleResource> samples = (Collection<SampleResource>) resources.get(ResourceType.PRODUCTSAMPLE);
        if (samples != null) {
            repoSamples.addAll(samples);
        }

        Collection<SampleResource> osiSamples = (Collection<SampleResource>) resources.get(ResourceType.OPENSOURCE);
        if (osiSamples != null) {
            repoSamples.addAll(osiSamples);
        }
    }
763276
@Override
    public RepositoryResult<Statement> getStatements(Resource subj, URI pred, Value obj, boolean includeInferred, Resource... contexts) throws RepositoryException {
        if (contexts == null) {
            contexts = new Resource[] { null };
        }
        try {
            if (isQuadMode()) {
                StringBuilder sb = new StringBuilder();
                sb.append("SELECT * WHERE { GRAPH ?ctx { ?s ?p ?o } filter (?ctx = (");
                boolean first = true;
                for (Resource context : contexts) {
                    if (first) {
                        first = !first;
                    }
                    else {
                        sb.append(",");
                    }
                    if (notNull(context)) {
                        sb.append("IRI(\"" + context.toString() + "\")");
                    } else {
                        sb.append("IRI(\""+DEFAULT_GRAPH_URI+"\")");
                    }
                }
                sb.append(") ) }");
                TupleQuery tupleQuery = prepareTupleQuery(sb.toString());
                tupleQuery.setIncludeInferred(includeInferred);
                setBindings(tupleQuery, subj, pred, obj, (Resource) null);
                TupleQueryResult qRes = tupleQuery.evaluate();
                return new RepositoryResult<Statement>(
                        new ExceptionConvertingIteration<Statement, RepositoryException>(
                                toStatementIteration(qRes, subj, pred, obj)) {
                            @Override
                            protected RepositoryException convert(Exception e) {
                                return new RepositoryException(e);
                            }
                        });
            } else if (subj != null && pred != null && obj != null) {
                if (hasStatement(subj, pred, obj, includeInferred, contexts)) {
                    Statement st = new StatementImpl(subj, pred, obj);
                    CloseableIteration<Statement, RepositoryException> cursor;
                    cursor = new SingletonIteration<Statement, RepositoryException>(st);
                    return new RepositoryResult<Statement>(cursor);
                } else {
                    return new RepositoryResult<Statement>(new EmptyIteration<Statement, RepositoryException>());
                }
            }
            else {
                MarkLogicGraphQuery query = prepareGraphQuery(EVERYTHING);
                setBindings(query, subj, pred, obj, contexts);
                GraphQueryResult result = query.evaluate();
                return new RepositoryResult<Statement>(
                        new ExceptionConvertingIteration<Statement, RepositoryException>(result) {
                            @Override
                            protected RepositoryException convert(Exception e) {
                                return new RepositoryException(e);
                            }
                        });
            }
        } catch (MalformedQueryException e) {
            throw new RepositoryException(e);
        } catch (QueryEvaluationException e) {
            throw new RepositoryException(e);
        }
    }
777214
function teamOutAction() {
        sessionStore.get(sessionId, function aa(_error, expressSession) {
            if (!expressSession) {
                log(1, sessionId, 'Session has expired', nonObjTemplatelogLevel);
            }

            if (!expressSession ||
                cachedController.controller.__template__.objectTemplate.getPendingCallCount() === 0) {
                controllers[sessionId + path] = null;
                log(1, sessionId, 'Expiring controller cache for ' + path, nonObjTemplatelogLevel);
            }
            else {
                cachedController.timeout = setTimeout(timeoutAction, objectCacheExpiration);
                log(2, sessionId, 'Extending controller cache timeout because of pending calls for ' + path,
 -                    nonObjTemplatelogLevel);
            }
        });
    }