Search in sources :

Example 46 with HttpClient

use of aQute.bnd.http.HttpClient in project bnd by bndtools.

the class Workspace method setTypeSpecificPlugins.

@Override
protected void setTypeSpecificPlugins(Set<Object> list) {
    try {
        super.setTypeSpecificPlugins(list);
        list.add(this);
        list.add(maven);
        list.add(settings);
        if (!isTrue(getProperty(NOBUILDINCACHE))) {
            list.add(new CachedFileRepo());
        }
        resourceRepositoryImpl = new ResourceRepositoryImpl();
        resourceRepositoryImpl.setCache(IO.getFile(getProperty(CACHEDIR, "~/.bnd/caches/shas")));
        resourceRepositoryImpl.setExecutor(getExecutor());
        resourceRepositoryImpl.setIndexFile(getFile(getBuildDir(), "repo.json"));
        resourceRepositoryImpl.setURLConnector(new MultiURLConnectionHandler(this));
        customize(resourceRepositoryImpl, null);
        list.add(resourceRepositoryImpl);
        //
        // Exporters
        //
        list.add(new SubsystemExporter());
        try {
            HttpClient client = new HttpClient();
            client.setOffline(getOffline());
            client.setRegistry(this);
            try (ConnectionSettings cs = new ConnectionSettings(this, client)) {
                cs.readSettings();
            }
            list.add(client);
        } catch (Exception e) {
            exception(e, "Failed to load the communication settings");
        }
    } catch (RuntimeException e) {
        throw e;
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
Also used : ResourceRepositoryImpl(aQute.bnd.resource.repository.ResourceRepositoryImpl) SubsystemExporter(aQute.bnd.exporter.subsystem.SubsystemExporter) HttpClient(aQute.bnd.http.HttpClient) MultiURLConnectionHandler(aQute.bnd.url.MultiURLConnectionHandler) ConnectionSettings(aQute.bnd.connection.settings.ConnectionSettings) IOException(java.io.IOException) TimeLimitExceededException(javax.naming.TimeLimitExceededException)

Aggregations

HttpClient (aQute.bnd.http.HttpClient)46 TaggedData (aQute.bnd.service.url.TaggedData)18 File (java.io.File)14 Processor (aQute.bnd.osgi.Processor)13 URI (java.net.URI)9 ProgressPlugin (aQute.bnd.service.progress.ProgressPlugin)6 Version (aQute.bnd.version.Version)6 IOException (java.io.IOException)6 URL (java.net.URL)6 HashMap (java.util.HashMap)6 ConnectionSettings (aQute.bnd.connection.settings.ConnectionSettings)5 Workspace (aQute.bnd.build.Workspace)4 ServerDTO (aQute.bnd.connection.settings.ServerDTO)4 RepositoryPlugin (aQute.bnd.service.RepositoryPlugin)4 Config (aQute.http.testservers.HttpTestServer.Config)4 Resource (org.osgi.resource.Resource)4 Jar (aQute.bnd.osgi.Jar)3 Slf4jReporter (aQute.libg.reporter.slf4j.Slf4jReporter)3 MavenRepository (aQute.maven.provider.MavenRepository)3 AtomicReference (java.util.concurrent.atomic.AtomicReference)3