org.apache.commons.httpclient.auth.AuthScope.getPort()方法的使用及代码示例

x33g5p2x  于11个月前 转载在 其他  
字(11.2k)|赞(0)|评价(0)|浏览(32)

本文整理了Java中org.apache.commons.httpclient.auth.AuthScope.getPort()方法的一些代码示例,展示了AuthScope.getPort()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AuthScope.getPort()方法的具体详情如下:
包路径:org.apache.commons.httpclient.auth.AuthScope
类名称:AuthScope
方法名:getPort

AuthScope.getPort介绍

暂无

代码示例

代码示例来源:origin: commons-httpclient/commons-httpclient

/** 
 * Creates a copy of the given credentials scope.
 * 
 * @since 3.0
 */
public AuthScope(final AuthScope authscope) {
  super();
  if (authscope == null) {
    throw new IllegalArgumentException("Scope may not be null");
  }
  this.host = authscope.getHost();
  this.port = authscope.getPort();
  this.realm = authscope.getRealm();
  this.scheme = authscope.getScheme();
}

代码示例来源:origin: commons-httpclient/commons-httpclient

private Credentials promptForCredentials(
  final AuthScheme authScheme,
  final HttpParams params, 
  final AuthScope authscope)
{
  LOG.debug("Credentials required");
  Credentials creds = null;
  CredentialsProvider credProvider = 
    (CredentialsProvider)params.getParameter(CredentialsProvider.PROVIDER);
  if (credProvider != null) {
    try {
      creds = credProvider.getCredentials(
        authScheme, authscope.getHost(), authscope.getPort(), false);
    } catch (CredentialsNotAvailableException e) {
      LOG.warn(e.getMessage());
    }
    if (creds != null) {
      this.state.setCredentials(authscope, creds);
      if (LOG.isDebugEnabled()) {
        LOG.debug(authscope + " new credentials given");
      }
    }
  } else {
    LOG.debug("Credentials provider not available");
  }
  return creds;
}

代码示例来源:origin: commons-httpclient/commons-httpclient

private Credentials promptForProxyCredentials(
  final AuthScheme authScheme,
  final HttpParams params,
  final AuthScope authscope) 
{
  LOG.debug("Proxy credentials required");
  Credentials creds = null;
  CredentialsProvider credProvider = 
    (CredentialsProvider)params.getParameter(CredentialsProvider.PROVIDER);
  if (credProvider != null) {
    try {
      creds = credProvider.getCredentials(
        authScheme, authscope.getHost(), authscope.getPort(), true);
    } catch (CredentialsNotAvailableException e) {
      LOG.warn(e.getMessage());
    }
    if (creds != null) {
      this.state.setProxyCredentials(authscope, creds);
      if (LOG.isDebugEnabled()) {
        LOG.debug(authscope + " new credentials given");
      }
    }
  } else {
    LOG.debug("Proxy credentials provider not available");
  }
  return creds;
}

代码示例来源:origin: org.jvnet.hudson/htmlunit

/**
 * @param port the request port for which Credentials are asked
 * @param scope the configured authorization scope
 * @return <code>true</code> if the scope's port matches the provided one
 */
protected boolean matchPort(final AuthScope scope, final int port) {
  return scope.getPort() == AuthScope.ANY_PORT || scope.getPort() == port;
}

代码示例来源:origin: org.jenkins-ci/htmlunit

/**
 * @param port the request port for which Credentials are asked
 * @param scope the configured authorization scope
 * @return <code>true</code> if the scope's port matches the provided one
 */
protected boolean matchPort(final AuthScope scope, final int port) {
  return scope.getPort() == AuthScope.ANY_PORT || scope.getPort() == port;
}

代码示例来源:origin: net.disy.htmlunit/htmlunit

/**
 * @param port the request port for which Credentials are asked
 * @param scope the configured authorization scope
 * @return <code>true</code> if the scope's port matches the provided one
 */
protected boolean matchPort(final AuthScope scope, final int port) {
  return scope.getPort() == AuthScope.ANY_PORT || scope.getPort() == port;
}

代码示例来源:origin: net.disy.htmlunit/htmlunit

private void writeObject(final ObjectOutputStream stream) throws IOException {
  stream.writeObject(authScope_.getHost());
  stream.writeInt(authScope_.getPort());
  stream.writeObject(authScope_.getRealm());
  stream.writeObject(authScope_.getScheme());
}
private void readObject(final ObjectInputStream stream) throws IOException, ClassNotFoundException {

代码示例来源:origin: org.jvnet.hudson/htmlunit

private void writeObject(final ObjectOutputStream stream) throws IOException {
  stream.writeObject(authScope_.getHost());
  stream.writeInt(authScope_.getPort());
  stream.writeObject(authScope_.getRealm());
  stream.writeObject(authScope_.getScheme());
}
private void readObject(final ObjectInputStream stream) throws IOException, ClassNotFoundException {

代码示例来源:origin: org.jenkins-ci/htmlunit

private void writeObject(final ObjectOutputStream stream) throws IOException {
  stream.writeObject(authScope_.getHost());
  stream.writeInt(authScope_.getPort());
  stream.writeObject(authScope_.getRealm());
  stream.writeObject(authScope_.getScheme());
}
private void readObject(final ObjectInputStream stream) throws IOException, ClassNotFoundException {

代码示例来源:origin: org.wso2.commons-httpclient/commons-httpclient

/** 
 * Creates a copy of the given credentials scope.
 * 
 * @since 3.0
 */
public AuthScope(final AuthScope authscope) {
  super();
  if (authscope == null) {
    throw new IllegalArgumentException("Scope may not be null");
  }
  this.host = authscope.getHost();
  this.port = authscope.getPort();
  this.realm = authscope.getRealm();
  this.scheme = authscope.getScheme();
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-httpclient

/** 
 * Creates a copy of the given credentials scope.
 * 
 * @since 3.0
 */
public AuthScope(final AuthScope authscope) {
  super();
  if (authscope == null) {
    throw new IllegalArgumentException("Scope may not be null");
  }
  this.host = authscope.getHost();
  this.port = authscope.getPort();
  this.realm = authscope.getRealm();
  this.scheme = authscope.getScheme();
}

代码示例来源:origin: org.apache.commons/com.springsource.org.apache.commons.httpclient

/** 
 * Creates a copy of the given credentials scope.
 * 
 * @since 3.0
 */
public AuthScope(final AuthScope authscope) {
  super();
  if (authscope == null) {
    throw new IllegalArgumentException("Scope may not be null");
  }
  this.host = authscope.getHost();
  this.port = authscope.getPort();
  this.realm = authscope.getRealm();
  this.scheme = authscope.getScheme();
}

代码示例来源:origin: org.apache.commons/httpclient

/** 
 * Creates a copy of the given credentials scope.
 * 
 * @since 3.0
 */
public AuthScope(final AuthScope authscope) {
  super();
  if (authscope == null) {
    throw new IllegalArgumentException("Scope may not be null");
  }
  this.host = authscope.getHost();
  this.port = authscope.getPort();
  this.realm = authscope.getRealm();
  this.scheme = authscope.getScheme();
}

代码示例来源:origin: org.apache.commons/com.springsource.org.apache.commons.httpclient

private Credentials promptForProxyCredentials(
  final AuthScheme authScheme,
  final HttpParams params,
  final AuthScope authscope) 
{
  LOG.debug("Proxy credentials required");
  Credentials creds = null;
  CredentialsProvider credProvider = 
    (CredentialsProvider)params.getParameter(CredentialsProvider.PROVIDER);
  if (credProvider != null) {
    try {
      creds = credProvider.getCredentials(
        authScheme, authscope.getHost(), authscope.getPort(), true);
    } catch (CredentialsNotAvailableException e) {
      LOG.warn(e.getMessage());
    }
    if (creds != null) {
      this.state.setProxyCredentials(authscope, creds);
      if (LOG.isDebugEnabled()) {
        LOG.debug(authscope + " new credentials given");
      }
    }
  } else {
    LOG.debug("Proxy credentials provider not available");
  }
  return creds;
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-httpclient

private Credentials promptForProxyCredentials(
  final AuthScheme authScheme,
  final HttpParams params,
  final AuthScope authscope) 
{
  LOG.debug("Proxy credentials required");
  Credentials creds = null;
  CredentialsProvider credProvider = 
    (CredentialsProvider)params.getParameter(CredentialsProvider.PROVIDER);
  if (credProvider != null) {
    try {
      creds = credProvider.getCredentials(
        authScheme, authscope.getHost(), authscope.getPort(), true);
    } catch (CredentialsNotAvailableException e) {
      LOG.warn(e.getMessage());
    }
    if (creds != null) {
      this.state.setProxyCredentials(authscope, creds);
      if (LOG.isDebugEnabled()) {
        LOG.debug(authscope + " new credentials given");
      }
    }
  } else {
    LOG.debug("Proxy credentials provider not available");
  }
  return creds;
}

代码示例来源:origin: org.apache.commons/httpclient

private Credentials promptForProxyCredentials(
  final AuthScheme authScheme,
  final HttpParams params,
  final AuthScope authscope) 
{
  LOG.debug("Proxy credentials required");
  Credentials creds = null;
  CredentialsProvider credProvider = 
    (CredentialsProvider)params.getParameter(CredentialsProvider.PROVIDER);
  if (credProvider != null) {
    try {
      creds = credProvider.getCredentials(
        authScheme, authscope.getHost(), authscope.getPort(), true);
    } catch (CredentialsNotAvailableException e) {
      LOG.warn(e.getMessage());
    }
    if (creds != null) {
      this.state.setProxyCredentials(authscope, creds);
      if (LOG.isDebugEnabled()) {
        LOG.debug(authscope + " new credentials given");
      }
    }
  } else {
    LOG.debug("Proxy credentials provider not available");
  }
  return creds;
}

代码示例来源:origin: org.zaproxy/zap

private Credentials promptForProxyCredentials(
  final AuthScheme authScheme,
  final HttpParams params,
  final AuthScope authscope) 
{
  LOG.debug("Proxy credentials required");
  Credentials creds = null;
  CredentialsProvider credProvider = 
    (CredentialsProvider)params.getParameter(CredentialsProvider.PROVIDER);
  if (credProvider != null) {
    try {
      creds = credProvider.getCredentials(
        authScheme, authscope.getHost(), authscope.getPort(), true);
    } catch (CredentialsNotAvailableException e) {
      LOG.warn(e.getMessage());
    }
    if (creds != null) {
      this.state.setProxyCredentials(authscope, creds);
      if (LOG.isDebugEnabled()) {
        LOG.debug(authscope + " new credentials given");
      }
    }
  } else {
    LOG.debug("Proxy credentials provider not available");
  }
  return creds;
}

代码示例来源:origin: org.wso2.commons-httpclient/commons-httpclient

private Credentials promptForProxyCredentials(
  final AuthScheme authScheme,
  final HttpParams params,
  final AuthScope authscope) 
{
  LOG.debug("Proxy credentials required");
  Credentials creds = null;
  CredentialsProvider credProvider = 
    (CredentialsProvider)params.getParameter(CredentialsProvider.PROVIDER);
  if (credProvider != null) {
    try {
      creds = credProvider.getCredentials(
        authScheme, authscope.getHost(), authscope.getPort(), true);
    } catch (CredentialsNotAvailableException e) {
      LOG.warn(e.getMessage());
    }
    if (creds != null) {
      this.state.setProxyCredentials(authscope, creds);
      if (LOG.isDebugEnabled()) {
        LOG.debug(authscope + " new credentials given");
      }
    }
  } else {
    LOG.debug("Proxy credentials provider not available");
  }
  return creds;
}

代码示例来源:origin: org.apache.commons/com.springsource.org.apache.commons.httpclient

private Credentials promptForCredentials(
  final AuthScheme authScheme,
  final HttpParams params, 
  final AuthScope authscope)
{
  LOG.debug("Credentials required");
  Credentials creds = null;
  CredentialsProvider credProvider = 
    (CredentialsProvider)params.getParameter(CredentialsProvider.PROVIDER);
  if (credProvider != null) {
    try {
      creds = credProvider.getCredentials(
        authScheme, authscope.getHost(), authscope.getPort(), false);
    } catch (CredentialsNotAvailableException e) {
      LOG.warn(e.getMessage());
    }
    if (creds != null) {
      this.state.setCredentials(authscope, creds);
      if (LOG.isDebugEnabled()) {
        LOG.debug(authscope + " new credentials given");
      }
    }
  } else {
    LOG.debug("Credentials provider not available");
  }
  return creds;
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-httpclient

private Credentials promptForCredentials(
  final AuthScheme authScheme,
  final HttpParams params, 
  final AuthScope authscope)
{
  LOG.debug("Credentials required");
  Credentials creds = null;
  CredentialsProvider credProvider = 
    (CredentialsProvider)params.getParameter(CredentialsProvider.PROVIDER);
  if (credProvider != null) {
    try {
      creds = credProvider.getCredentials(
        authScheme, authscope.getHost(), authscope.getPort(), false);
    } catch (CredentialsNotAvailableException e) {
      LOG.warn(e.getMessage());
    }
    if (creds != null) {
      this.state.setCredentials(authscope, creds);
      if (LOG.isDebugEnabled()) {
        LOG.debug(authscope + " new credentials given");
      }
    }
  } else {
    LOG.debug("Credentials provider not available");
  }
  return creds;
}

相关文章