ExtensionRepository
493519
@Override
    public Extension resolve(ExtensionId extensionId) throws ResolveException
    {
        try {
            return resolve(extensionId.getId(), extensionId.getVersion());
        } catch (ResourceNotFoundException e) {
            throw new ExtensionNotFoundException("Could not find extension [" + extensionId + "]", e);
        } catch (Exception e) {
            throw new ResolveException("Failed to create extension object for extension [" + extensionId + "]", e);
        }
    }
391276
public static Repository getRepository( String repositoryName ) throws NoSuchRepositoryException {
        Repository repository = null;
        try {
            repository = repositoriesContainer.getRepository(repositoryName, Collections.unmodifiableMap(factoryParams));
        } catch (RepositoryException e) {
            throw new NoSuchRepositoryException(WebJcrI18n.cannotInitializeRepository.text(repositoryName), e);
        }

        if (repository == null) {
            throw new NoSuchRepositoryException(WebJcrI18n.repositoryNotFound.text(repositoryName));
        }
        return repository;
    }
421416
@Provides @Singleton
    public List<RemoteRepository> getRemoteRepositories(
            SettingsDecrypter decrypter,
            ExtensionList<RemoteRepositoryDecorator> decorators) {

        List<RemoteRepository> repositories = new ArrayList<RemoteRepository>();
        MavenDependencyResolverSettings resolverSettings = new MavenDependencyResolverSettings();
        resolverSettings.setUseMavenCentral(true);
        List<RemoteRepository> repos = resolverSettings.getRemoteRepositories();
        for (RemoteRepository remoteRepository : repos) {
            Server server = resolverSettings.getSettings().getServer(remoteRepository.getId());
            if (server != null) {
                server = decrypter.decrypt(new DefaultSettingsDecryptionRequest(server)).getServer();
                remoteRepository.setAuthentication(new Authentication(server.getUsername(), server.getPassword(), server.getPrivateKey(), server.getPassphrase()));
            }
            repositories.add(decorate(remoteRepository, decorators));
        }
        RemoteRepository r = new RemoteRepository("cloudbees-public-release", "default", "https://repository-cloudbees.forge.cloudbees.com/public-release/");
        repositories.add(decorate(r,decorators));
        return repositories;
    }
600170
public <T> void load(ExtensionRepository<T> repository, Class<T> extensionType) {
//		loadExtensionFromPackage(repository, extensionType, getDefaultScanPackage());
//		String customScanPackage = getCustomScanPackage();
//		if (!Strings.isNullOrEmpty(customScanPackage)) {
//			loadExtensionFromPackage(repository, extensionType, customScanPackage);
//		}
		loadMetricsFromSPI(repository, extensionType);
	}
186094
public void addBootstrapRepository(RepositoryAdmin repositoryAdmin, BundleContext context)
    {
        if (repositoryAdmin == null)
            return;
        String repository = context.getProperty("jbundle.repository.url");
        if (repository != null)
        	if (repository.length() > 0)
        		this.addRepository(repositoryAdmin, repository);

        //repository = "file:" + System.getProperty("user.home") + File.separator + ".m2" + File.separator  + "full-repository.xml";
        //this.addRepository(repositoryAdmin, repository);        
    }
1242650
@Override
    public Extension resolve(ExtensionId extensionId) throws ResolveException
    {
        ResolveException lastException = null;

        for ( repository : this.repositories) {
            try {
                return repository.resolve(extensionId);
            } catch (ExtensionNotFoundException e1) {
                this.logger.debug("Could not find extension [{}] in repository [{}]", extensionId,
                    repository.getDescriptor(), e1);
            } catch (ResolveException e2) {
                this.logger.error("Unexpected error when trying to find extension [{}] in repository [{}]", extensionId,
                    repository.getDescriptor(), e2);

                lastException = e2;
            }
        }

        if (lastException != null) {
            throw new ResolveException(MessageFormat.format("Failed to resolve extension [{0}]", extensionId),
                lastException);
        } else {
            throw new ExtensionNotFoundException(MessageFormat.format("Could not find extension [{0}]", extensionId));
        }
    }
848393
public void addRemoteRepositoryByUrl(String url) throws NaetherException {
        try {
            addRemoteRepository(RepoBuilder.remoteRepositoryFromUrl(url));
        } catch (MalformedURLException e) {
            log.error( "Malformed url: {}", url, e);
            throw new NaetherException(e);
        }
    }
386589
@SuppressWarnings("unchecked")
    public static Set<Repository> toRepositoryList(Vector<Object> repositoriesParams)
    {
        Set<Repository> repositories = new TreeSet<Repository>();
        for(Object repositoryParams : repositoriesParams)
        {
            repositories.add(toRepository((Vector<Object>)repositoryParams));
        }
        
        return repositories;
    }
1246163
private CompletableFuture<Void> createRepository(CreateRepositoryCommand c) {
        return CompletableFuture.supplyAsync(() -> {
            projectManager.get(c.projectName()).repos().create(c.repositoryName(), c.timestamp(), c.author());
            return null;
        }, repositoryWorker);
    }
315392
public function addRepository(
        string $appName,
        string $indexName,
        TransformableRepository $repository
    ) {
        $this->repositories[$appName][$indexName] = $repository;
    }
303819
public Repositories.Repository getRepository( String name ) {
        JSONRestClient.Response response = jsonRestClient.doGet();
        if (!response.isOK()) {
            throw new RuntimeException(JdbcI18n.invalidServerResponse.text(jsonRestClient.url(), response.asString()));
        }
        return new Repositories(response.json()).getRepository(name);
    }
262408
public static void installResourceExtension(DatabaseClient client)
    throws IOException
  {
    // create a manager for resource extensions
    ResourceExtensionsManager resourceMgr = client.newServerConfigManager().newResourceExtensionsManager();

    // specify metadata about the resource extension
    ExtensionMetadata metadata = new ExtensionMetadata();
    metadata.setTitle("Search Collector Resource Services");
    metadata.setDescription("This plugin collects documents qualified by search");
    metadata.setProvider("MarkLogic");
    metadata.setVersion("0.1");

    // acquire the resource extension source code
    try ( InputStream sourceStream = Util.openStream("scripts"+File.separator+SearchCollector.NAME+".xqy") ) {
      if (sourceStream == null) throw new RuntimeException("Could not read example resource extension");

      // create a handle on the extension source code
      InputStreamHandle handle = new InputStreamHandle(sourceStream);
      handle.set(sourceStream);

      MethodParameters getParams = new MethodParameters(MethodType.GET);
      getParams.add("format",     "xs:string");
      getParams.add("options",    "xs:string");
      getParams.add("pageLength", "xs:string");
      getParams.add("start",      "xs:string");
      getParams.add("view",       "xs:string");

      getParams.add("q",          "xs:string");

      MethodParameters postParams = new MethodParameters(MethodType.POST);
      postParams.add("format",     "xs:string");
      postParams.add("options",    "xs:string");
      postParams.add("pageLength", "xs:string");
      postParams.add("start",      "xs:string");
      postParams.add("view",       "xs:string");

      // write the resource extension to the database
      resourceMgr.writeServices(SearchCollector.NAME, handle, metadata, getParams, postParams);
    }

    System.out.println("Installed the resource extension on the server");
  }
395554
@Override
    public void addRemoteRepo(MavenRemoteRepository repository) {
        Builder builder = new Builder(repository.getId(), repository.getType(), repository.getUrl());
        builder.setPolicy(new RepositoryPolicy(true, repository.getUpdatePolicy() == null ? null : repository
                .getUpdatePolicy().apiValue(), repository.getChecksumPolicy() == null ? null : repository
                .getChecksumPolicy().apiValue()));

        for (RemoteRepository r : this.additionalRemoteRepositories) {
            if (r.getId().equals(repository.getId())) {
                this.additionalRemoteRepositories.remove(r);
            }
        }
        this.additionalRemoteRepositories.add(builder.build());
    }
225884
function onRepositorySet(repo) {
    if (repo instanceof Array) {
      socket.repositories = repo;
    }
    self.emit('connect', socket);
  }
606876
public Repository getRepository(String instanceId) throws WIMException {
        RepositoryWrapper repositoryHolder = repositories.get(instanceId);
        if (repositoryHolder != null) {
            return repositoryHolder.getRepository();
        }
        return null;
    }
813758
def Repository(self, *dirs):
        """"""
        for d in dirs:
            if not isinstance(d, SCons.Node.Node):
                d = self.Dir(d)
            self.Top.addRepository(d)
708677
public static void registerArchiveFileProvider(Class<? extends IArchiveFile> provider, String fileExtension){
		extensionMap.put(fileExtension, provider);
	}