Tabnine Logo
org.apache.commons.httpclient
Code IndexAdd Tabnine to your IDE (free)

How to use org.apache.commons.httpclient

Best Java code snippets using org.apache.commons.httpclient (Showing top 20 results out of 3,672)

origin: commons-httpclient/commons-httpclient

/**
 * Adds the specified request header, NOT overwriting any previous value.
 * Note that header-name matching is case insensitive.
 *
 * @param headerName the header's name
 * @param headerValue the header's value
 */
public void addRequestHeader(String headerName, String headerValue) {
  addRequestHeader(new Header(headerName, headerValue));
}
origin: commons-httpclient/commons-httpclient

public void releaseConnection() {
  if (!isLocked() && hasConnection()) {
    HttpConnection wrappedConnection = this.wrappedConnection;
    this.wrappedConnection = null;
    wrappedConnection.releaseConnection();
  } else {
    // do nothing
  }
}
origin: commons-httpclient/commons-httpclient

/**
 * Verify the valid class use for construction.
 *
 * @throws URIException the wrong scheme use
 */
protected void checkValid() throws URIException {
  // could be explicit protocol or undefined.
  if (!(equals(_scheme, DEFAULT_SCHEME) || _scheme == null)) {
    throw new URIException(URIException.PARSING, "wrong class use");
  }
}
origin: jenkinsci/jenkins

  private Credentials createCredentials(String userName, String password) {
    if (userName.indexOf('\\') >= 0){
      final String domain = userName.substring(0, userName.indexOf('\\'));
      final String user = userName.substring(userName.indexOf('\\') + 1);
      return new NTCredentials(user, Secret.fromString(password).getPlainText(), "", domain);
    } else {
      return new UsernamePasswordCredentials(userName, Secret.fromString(password).getPlainText());
    }
  }
}
origin: commons-httpclient/commons-httpclient

public void close() {
  if (hasConnection()) {
    wrappedConnection.close();
  } else {
    // do nothing
  }
}
origin: commons-httpclient/commons-httpclient

/**
 * Verify the valid class use for construction.
 *
 * @throws URIException the wrong scheme use
 */
protected void checkValid() throws URIException {
  // could be explicit protocol or undefined.
  if (!(equals(_scheme, DEFAULT_SCHEME) || _scheme == null)) {
    throw new URIException(URIException.PARSING, "wrong class use");
  }
}
origin: commons-httpclient/commons-httpclient

public void setLastResponseInputStream(InputStream inStream) {
  if (hasConnection()) {
    wrappedConnection.setLastResponseInputStream(inStream);
  } else {
    // do nothing
  }
}
origin: commons-httpclient/commons-httpclient

public InputStream getLastResponseInputStream() {
  if (hasConnection()) {
    return wrappedConnection.getLastResponseInputStream();
  } else {
    return null;
  }
}
origin: commons-httpclient/commons-httpclient

public void setProxyPort(int port) throws IllegalStateException {
  if (hasConnection()) {
    wrappedConnection.setProxyPort(port);
  } else {
    // do nothing
  }
}
origin: commons-httpclient/commons-httpclient

public boolean isSecure() {
  if (hasConnection()) {
    return wrappedConnection.isSecure();
  } else {
    return false;
  }
}
origin: commons-httpclient/commons-httpclient

/**
 * Use this method internally to add footers.
 * 
 * @param footer The footer to add.
 */
public void addResponseFooter(Header footer) {
  getResponseTrailerHeaderGroup().addHeader(footer);
}
origin: commons-httpclient/commons-httpclient

public int getPort() {
  if (hasConnection()) {
    return wrappedConnection.getPort();
  } else {
    return -1;
  }
}
origin: commons-httpclient/commons-httpclient

public Protocol getProtocol() {
  if (hasConnection()) {
    return wrappedConnection.getProtocol();
  } else {
    return null;
  }
}
origin: commons-httpclient/commons-httpclient

/**
 * @see org.apache.commons.httpclient.HttpMethod#getResponseHeaders(java.lang.String)
 * 
 * @since 3.0
 */
public Header[] getResponseHeaders(String headerName) {
  return getResponseHeaderGroup().getHeaders(headerName);
}
origin: commons-httpclient/commons-httpclient

public boolean isResponseAvailable() throws IOException {
  if (hasConnection()) {
    return  wrappedConnection.isResponseAvailable();
  } else {
    return false;
  }
}
origin: commons-httpclient/commons-httpclient

public boolean isTransparent() {
  if (hasConnection()) {
    return wrappedConnection.isTransparent();
  } else {
    return false;
  }
}
origin: commons-httpclient/commons-httpclient

public InetAddress getLocalAddress() {
  if (hasConnection()) {
    return wrappedConnection.getLocalAddress();
  } else {
    return null;
  }
}
origin: commons-httpclient/commons-httpclient

/**
 * @deprecated
 */
public boolean isStaleCheckingEnabled() {
  if (hasConnection()) {
    return wrappedConnection.isStaleCheckingEnabled();
  } else {
    return false;
  }
}
origin: commons-httpclient/commons-httpclient

public HttpConnectionManager getHttpConnectionManager() {
  if (hasConnection()) {
    return wrappedConnection.getHttpConnectionManager();
  } else {
    return null;
  }
}
origin: commons-httpclient/commons-httpclient

public boolean isResponseAvailable(int timeout) throws IOException {
  if (hasConnection()) {
    return  wrappedConnection.isResponseAvailable(timeout);
  } else {
    return false;
  }
}
org.apache.commons.httpclient

Most used classes

  • HttpClient
    An HTTP "user-agent", containing an HttpState and one or more HttpConnection, to which HttpMethod c
  • GetMethod
    Implements the HTTP GET method. The HTTP GET method is defined in section 9.3 ofRFC2616 [http://www.
  • PostMethod
    Implements the HTTP POST method. The HTTP POST method is defined in section 9.5 ofRFC2616 [http://ww
  • HttpClientParams
    This class represents a collection of HTTP protocol parameters applicable to org.apache.commons.http
  • Header
    An HTTP header.
  • HttpState,
  • UsernamePasswordCredentials,
  • HostConfiguration,
  • HttpConnectionManagerParams,
  • MultiThreadedHttpConnectionManager,
  • HttpMethodParams,
  • NameValuePair,
  • HttpConnectionManager,
  • PutMethod,
  • StringRequestEntity,
  • HttpMethodBase,
  • URI,
  • AuthScope,
  • Protocol
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