Tabnine Logo
HttpClientConnection
Code IndexAdd Tabnine to your IDE (free)

How to use
HttpClientConnection
in
org.eclipse.jgit.transport.http.apache

Best Java code snippets using org.eclipse.jgit.transport.http.apache.HttpClientConnection (Showing top 20 results out of 315)

origin: spring-cloud/spring-cloud-config

@Override
public HttpConnection create(URL url, Proxy proxy) throws IOException {
  return new HttpClientConnection(url.toString(), null, lookupHttpClientBuilder(url).build());
}
origin: org.eclipse.jgit/org.eclipse.jgit.http.apache

/** {@inheritDoc} */
@Override
public void connect() throws IOException {
  execute();
}
origin: sonia.jgit/org.eclipse.jgit.http.apache

  public void configure(KeyManager[] km, TrustManager[] tm,
      SecureRandom random) throws KeyManagementException {
    getSSLContext().init(km, tm, random);
  }
}
origin: sonia.jgit/org.eclipse.jgit.http.apache

private void execute() throws IOException, ClientProtocolException {
  if (resp != null) {
    return;
  }
  if (entity == null) {
    resp = getClient().execute(req);
    return;
  }
  try {
    if (req instanceof HttpEntityEnclosingRequest) {
      HttpEntityEnclosingRequest eReq = (HttpEntityEnclosingRequest) req;
      eReq.setEntity(entity);
    }
    resp = getClient().execute(req);
  } finally {
    entity.close();
    entity = null;
  }
}
origin: com.madgag/org.eclipse.jgit.http.apache

public void connect() throws IOException {
  execute();
}
origin: org.eclipse.jgit/org.eclipse.jgit.http.apache

  /** {@inheritDoc} */
  @Override
  public void configure(KeyManager[] km, TrustManager[] tm,
      SecureRandom random) throws KeyManagementException {
    getSSLContext().init(km, tm, random);
  }
}
origin: com.madgag/org.eclipse.jgit.http.apache

private void execute() throws IOException, ClientProtocolException {
  if (resp == null)
    if (entity != null) {
      if (req instanceof HttpEntityEnclosingRequest) {
        HttpEntityEnclosingRequest eReq = (HttpEntityEnclosingRequest) req;
        eReq.setEntity(entity);
      }
      resp = getClient().execute(req);
      entity.getBuffer().close();
      entity = null;
    } else
      resp = getClient().execute(req);
}
origin: org.eclipse.jgit/org.eclipse.jgit.http.apache

/** {@inheritDoc} */
@Override
public HttpConnection create(URL url) throws IOException {
  return new HttpClientConnection(url.toString());
}
origin: sonia.jgit/org.eclipse.jgit.http.apache

public void connect() throws IOException {
  execute();
}
origin: com.madgag/org.eclipse.jgit.http.apache

  public void configure(KeyManager[] km, TrustManager[] tm,
      SecureRandom random) throws KeyManagementException {
    getSSLContext().init(km, tm, random);
  }
}
origin: org.eclipse.jgit/org.eclipse.jgit.http.apache

private void execute() throws IOException, ClientProtocolException {
  if (resp != null) {
    return;
  }
  if (entity == null) {
    resp = getClient().execute(req);
    return;
  }
  try {
    if (req instanceof HttpEntityEnclosingRequest) {
      HttpEntityEnclosingRequest eReq = (HttpEntityEnclosingRequest) req;
      eReq.setEntity(entity);
    }
    resp = getClient().execute(req);
  } finally {
    entity.close();
    entity = null;
  }
}
origin: org.eclipse.jgit/org.eclipse.jgit.http.apache

  /** {@inheritDoc} */
  @Override
  public HttpConnection create(URL url, Proxy proxy)
      throws IOException {
    return new HttpClientConnection(url.toString(), proxy);
  }
}
origin: org.eclipse.jgit/org.eclipse.jgit.http.apache

/** {@inheritDoc} */
@Override
public String getResponseMessage() throws IOException {
  execute();
  return resp.getStatusLine().getReasonPhrase();
}
origin: org.eclipse.jgit/org.eclipse.jgit.http.apache

    getSSLContext(), hostnameverifier);
clientBuilder.setSSLSocketFactory(sslConnectionFactory);
Registry<ConnectionSocketFactory> registry = RegistryBuilder
origin: sonia.jgit/org.eclipse.jgit.http.apache

  public HttpConnection create(URL url, Proxy proxy)
      throws IOException {
    return new HttpClientConnection(url.toString(), proxy);
  }
}
origin: org.eclipse.jgit/org.eclipse.jgit.http.apache

/** {@inheritDoc} */
@Override
public int getResponseCode() throws IOException {
  execute();
  return resp.getStatusLine().getStatusCode();
}
origin: sonia.jgit/org.eclipse.jgit.http.apache

private HttpClient getClient() {
  if (client == null)
    client = new DefaultHttpClient();
  HttpParams params = client.getParams();
  if (proxy != null && !Proxy.NO_PROXY.equals(proxy)) {
    isUsingProxy = true;
    InetSocketAddress adr = (InetSocketAddress) proxy.address();
    params.setParameter(ConnRoutePNames.DEFAULT_PROXY,
        new HttpHost(adr.getHostName(), adr.getPort()));
  }
  if (timeout != null)
    params.setIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT,
        timeout.intValue());
  if (readTimeout != null)
    params.setIntParameter(CoreConnectionPNames.SO_TIMEOUT,
        readTimeout.intValue());
  if (followRedirects != null)
    params.setBooleanParameter(ClientPNames.HANDLE_REDIRECTS,
        followRedirects.booleanValue());
  if (hostnameverifier != null) {
    SSLSocketFactory sf;
    sf = new SSLSocketFactory(getSSLContext(), hostnameverifier);
    Scheme https = new Scheme("https", 443, sf); //$NON-NLS-1$
    client.getConnectionManager().getSchemeRegistry().register(https);
  }
  return client;
}
origin: com.madgag/org.eclipse.jgit.http.apache

  public HttpConnection create(URL url, Proxy proxy)
      throws IOException {
    return new HttpClientConnection(url.toString(), proxy);
  }
}
origin: sonia.jgit/org.eclipse.jgit.http.apache

public String getResponseMessage() throws IOException {
  execute();
  return resp.getStatusLine().getReasonPhrase();
}
origin: com.madgag/org.eclipse.jgit.http.apache

private HttpClient getClient() {
  if (client == null)
    client = new DefaultHttpClient();
  HttpParams params = client.getParams();
  if (proxy != null && !Proxy.NO_PROXY.equals(proxy)) {
    isUsingProxy = true;
    InetSocketAddress adr = (InetSocketAddress) proxy.address();
    params.setParameter(ConnRoutePNames.DEFAULT_PROXY,
        new HttpHost(adr.getHostName(), adr.getPort()));
  }
  if (timeout != null)
    params.setIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT,
        timeout.intValue());
  if (readTimeout != null)
    params.setIntParameter(CoreConnectionPNames.SO_TIMEOUT,
        readTimeout.intValue());
  if (followRedirects != null)
    params.setBooleanParameter(ClientPNames.HANDLE_REDIRECTS,
        followRedirects.booleanValue());
  if (hostnameverifier != null) {
    SSLSocketFactory sf;
    sf = new SSLSocketFactory(getSSLContext(), hostnameverifier);
    Scheme https = new Scheme("https", 443, sf); //$NON-NLS-1$
    client.getConnectionManager().getSchemeRegistry().register(https);
  }
  return client;
}
org.eclipse.jgit.transport.http.apacheHttpClientConnection

Javadoc

A HttpConnection which uses HttpClient

Most used methods

  • <init>
  • execute
  • getClient
  • getSSLContext

Popular in Java

  • Reading from database using SQL prepared statement
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • setContentView (Activity)
  • scheduleAtFixedRate (Timer)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now