Search in sources :

Example 1 with FixedIndexedRepo

use of aQute.bnd.deployer.repository.FixedIndexedRepo in project bnd by bndtools.

the class ResolveProcessTest method getIndex.

protected FixedIndexedRepo getIndex(String location) throws MalformedURLException, URISyntaxException {
    File index = IO.getFile(location);
    FixedIndexedRepo fir = new FixedIndexedRepo();
    fir.setLocations(index.toURI().toString());
    return fir;
}
Also used : File(java.io.File) FixedIndexedRepo(aQute.bnd.deployer.repository.FixedIndexedRepo)

Example 2 with FixedIndexedRepo

use of aQute.bnd.deployer.repository.FixedIndexedRepo in project bnd by bndtools.

the class IndexedReposWithComms method testIndexedRepo.

/*
	 * Uses workspaces/indexed Sets up a FixedIndexedRepo to the local server.
	 */
public void testIndexedRepo() throws IOException, Exception {
    try (HttpTestServer ht = http()) {
        createSecureSocks5();
        Workspace ws = Workspace.getWorkspace(aQute.lib.io.IO.getFile("workspaces/indexed"));
        assertNotNull(ws);
        ws.setProperty("repo", ht.getBaseURI().toASCIIString() + "/index");
        FixedIndexedRepo plugin = ws.getPlugin(FixedIndexedRepo.class);
        assertTrue(ws.check());
        assertNotNull(plugin);
        List<String> list = plugin.list(null);
        assertTrue(ws.check());
        assertTrue(list.size() > 0);
    }
}
Also used : HttpTestServer(aQute.http.testservers.HttpTestServer) FixedIndexedRepo(aQute.bnd.deployer.repository.FixedIndexedRepo) Workspace(aQute.bnd.build.Workspace)

Example 3 with FixedIndexedRepo

use of aQute.bnd.deployer.repository.FixedIndexedRepo in project bnd by bndtools.

the class IndexedReposWithComms method testIndexedRepoWithPassword.

/*
	 * Uses workspaces/indexed Sets up a FixedIndexedRepo to the local server.
	 */
public void testIndexedRepoWithPassword() throws IOException, Exception {
    try (HttpTestServer ht = https()) {
        createSecureSocks5();
        Workspace ws = Workspace.getWorkspace(aQute.lib.io.IO.getFile("workspaces/indexed"));
        assertNotNull(ws);
        ws.setProperty("-connection-settings", "${build}/settings-withpassword.xml");
        ws.setProperty("repo", ht.getBaseURI().toASCIIString() + "/index-auth/user/good");
        FixedIndexedRepo plugin = ws.getPlugin(FixedIndexedRepo.class);
        assertTrue(ws.check());
        assertNotNull(plugin);
        List<String> list = plugin.list(null);
        assertTrue(ws.check());
        assertTrue(list.size() > 0);
    }
}
Also used : HttpTestServer(aQute.http.testservers.HttpTestServer) FixedIndexedRepo(aQute.bnd.deployer.repository.FixedIndexedRepo) Workspace(aQute.bnd.build.Workspace)

Example 4 with FixedIndexedRepo

use of aQute.bnd.deployer.repository.FixedIndexedRepo in project bnd by bndtools.

the class ResourceTest method getResources.

private Set<Resource> getResources(String locations) throws MalformedURLException, URISyntaxException {
    FixedIndexedRepo repo = new FixedIndexedRepo();
    repo.setLocations(locations);
    Requirement wildcard = ResourceUtils.createWildcardRequirement();
    Collection<Capability> caps = repo.findProviders(Collections.singleton(wildcard)).get(wildcard);
    return ResourceUtils.getResources(caps);
}
Also used : Requirement(org.osgi.resource.Requirement) Capability(org.osgi.resource.Capability) FixedIndexedRepo(aQute.bnd.deployer.repository.FixedIndexedRepo)

Example 5 with FixedIndexedRepo

use of aQute.bnd.deployer.repository.FixedIndexedRepo in project bnd by bndtools.

the class ResolverValidator method getRepository.

FixedIndexedRepo getRepository() throws MalformedURLException, URISyntaxException {
    FixedIndexedRepo repository = new FixedIndexedRepo();
    repository.setLocations(Strings.join(repositories));
    return repository;
}
Also used : FixedIndexedRepo(aQute.bnd.deployer.repository.FixedIndexedRepo)

Aggregations

FixedIndexedRepo (aQute.bnd.deployer.repository.FixedIndexedRepo)12 File (java.io.File)3 HashMap (java.util.HashMap)3 Workspace (aQute.bnd.build.Workspace)2 HttpTestServer (aQute.http.testservers.HttpTestServer)2 Resource (org.osgi.resource.Resource)2 Processor (aQute.bnd.osgi.Processor)1 BndPreferences (bndtools.preferences.BndPreferences)1 IOException (java.io.IOException)1 HttpURLConnection (java.net.HttpURLConnection)1 URISyntaxException (java.net.URISyntaxException)1 UnknownHostException (java.net.UnknownHostException)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 RepositorySystem (org.eclipse.aether.RepositorySystem)1 DefaultServiceLocator (org.eclipse.aether.impl.DefaultServiceLocator)1 ErrorHandler (org.eclipse.aether.impl.DefaultServiceLocator.ErrorHandler)1 LocalRepository (org.eclipse.aether.repository.LocalRepository)1 Builder (org.eclipse.aether.repository.RemoteRepository.Builder)1 AuthenticationBuilder (org.eclipse.aether.util.repository.AuthenticationBuilder)1