org.apache.commons.httpclient.HttpURL.getRawHost()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(15.5k)|赞(0)|评价(0)|浏览(156)

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

HttpURL.getRawHost介绍

暂无

代码示例

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

/**
 * Set the raw-escaped user.
 *
 * @param escapedUser the raw-escaped user
 * @throws URIException escaped user not valid or user required
 */
public void setRawUser(char[] escapedUser) throws URIException {
  if (escapedUser == null || escapedUser.length == 0) {
    throw new URIException(URIException.PARSING, "user required");
  }
  if (!validate(escapedUser, within_userinfo)) {
    throw new URIException(URIException.ESCAPING,
        "escaped user not valid");
  }
  String username = new String(escapedUser);
  char[] rawPassword = getRawPassword();
  String password = rawPassword == null ? null : new String(rawPassword);
  String userinfo = username + ((password == null) ? "" : ":" + password);
  String hostname = new String(getRawHost());
  String hostport = (_port == -1) ? hostname : hostname + ":" + _port;
  String authority = userinfo + "@" + hostport;
  _userinfo = userinfo.toCharArray();
  _authority = authority.toCharArray();
  setURI();
}

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

/**
 * Set the raw-escaped user and password.
 *
 * @param escapedUser the raw-escaped user
 * @param escapedPassword the raw-escaped password; could be null
 * @throws URIException escaped user not valid or user required; escaped
 * password not valid or username missed
 */
public void setRawUserinfo(char[] escapedUser, char[] escapedPassword)
  throws URIException {
  if (escapedUser == null || escapedUser.length == 0) {
    throw new URIException(URIException.PARSING, "user required");
  }
  if (!validate(escapedUser, within_userinfo) 
    || ((escapedPassword != null) 
    && !validate(escapedPassword, within_userinfo))) {
    throw new URIException(URIException.ESCAPING,
        "escaped userinfo not valid");
  }
  String username = new String(escapedUser);
  String password = (escapedPassword == null) 
    ? null : new String(escapedPassword);
  String userinfo = username + ((password == null) ? "" : ":" + password);
  String hostname = new String(getRawHost());
  String hostport = (_port == -1) ? hostname : hostname + ":" + _port;
  String authority = userinfo + "@" + hostport;
  _userinfo = userinfo.toCharArray();
  _authority = authority.toCharArray();
  setURI();
}

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

/**
 * Set the raw-escaped password.
 *
 * @param escapedPassword the raw-escaped password; could be null
 * @throws URIException escaped password not valid or username missed
 */
public void setRawPassword(char[] escapedPassword) throws URIException {
  if (escapedPassword != null 
    && !validate(escapedPassword, within_userinfo)) {
    throw new URIException(URIException.ESCAPING,
      "escaped password not valid");
  }
  if (getRawUser() == null || getRawUser().length == 0) {
    throw new URIException(URIException.PARSING, "username required");
  }
  String username = new String(getRawUser());
  String password = escapedPassword == null ? null : new String(escapedPassword);
  // an emtpy string is allowed as a password
  String userinfo = username + ((password == null) ? "" : ":" + password);
  String hostname = new String(getRawHost());
  String hostport = (_port == -1) ? hostname : hostname + ":" + _port;
  String authority = userinfo + "@" + hostport;
  _userinfo = userinfo.toCharArray();
  _authority = authority.toCharArray();
  setURI();
}

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

/**
 * Set the raw-escaped user.
 *
 * @param escapedUser the raw-escaped user
 * @throws URIException escaped user not valid or user required
 */
public void setRawUser(char[] escapedUser) throws URIException {
  if (escapedUser == null || escapedUser.length == 0) {
    throw new URIException(URIException.PARSING, "user required");
  }
  if (!validate(escapedUser, within_userinfo)) {
    throw new URIException(URIException.ESCAPING,
        "escaped user not valid");
  }
  String username = new String(escapedUser);
  char[] rawPassword = getRawPassword();
  String password = rawPassword == null ? null : new String(rawPassword);
  String userinfo = username + ((password == null) ? "" : ":" + password);
  String hostname = new String(getRawHost());
  String hostport = (_port == -1) ? hostname : hostname + ":" + _port;
  String authority = userinfo + "@" + hostport;
  _userinfo = userinfo.toCharArray();
  _authority = authority.toCharArray();
  setURI();
}

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

/**
 * Set the raw-escaped user.
 *
 * @param escapedUser the raw-escaped user
 * @throws URIException escaped user not valid or user required
 */
public void setRawUser(char[] escapedUser) throws URIException {
  if (escapedUser == null || escapedUser.length == 0) {
    throw new URIException(URIException.PARSING, "user required");
  }
  if (!validate(escapedUser, within_userinfo)) {
    throw new URIException(URIException.ESCAPING,
        "escaped user not valid");
  }
  String username = new String(escapedUser);
  char[] rawPassword = getRawPassword();
  String password = rawPassword == null ? null : new String(rawPassword);
  String userinfo = username + ((password == null) ? "" : ":" + password);
  String hostname = new String(getRawHost());
  String hostport = (_port == -1) ? hostname : hostname + ":" + _port;
  String authority = userinfo + "@" + hostport;
  _userinfo = userinfo.toCharArray();
  _authority = authority.toCharArray();
  setURI();
}

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

/**
 * Set the raw-escaped user.
 *
 * @param escapedUser the raw-escaped user
 * @throws URIException escaped user not valid or user required
 */
public void setRawUser(char[] escapedUser) throws URIException {
  if (escapedUser == null || escapedUser.length == 0) {
    throw new URIException(URIException.PARSING, "user required");
  }
  if (!validate(escapedUser, within_userinfo)) {
    throw new URIException(URIException.ESCAPING,
        "escaped user not valid");
  }
  String username = new String(escapedUser);
  char[] rawPassword = getRawPassword();
  String password = rawPassword == null ? null : new String(rawPassword);
  String userinfo = username + ((password == null) ? "" : ":" + password);
  String hostname = new String(getRawHost());
  String hostport = (_port == -1) ? hostname : hostname + ":" + _port;
  String authority = userinfo + "@" + hostport;
  _userinfo = userinfo.toCharArray();
  _authority = authority.toCharArray();
  setURI();
}

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

/**
 * Set the raw-escaped user.
 *
 * @param escapedUser the raw-escaped user
 * @throws URIException escaped user not valid or user required
 */
public void setRawUser(char[] escapedUser) throws URIException {
  if (escapedUser == null || escapedUser.length == 0) {
    throw new URIException(URIException.PARSING, "user required");
  }
  if (!validate(escapedUser, within_userinfo)) {
    throw new URIException(URIException.ESCAPING,
        "escaped user not valid");
  }
  String username = new String(escapedUser);
  char[] rawPassword = getRawPassword();
  String password = rawPassword == null ? null : new String(rawPassword);
  String userinfo = username + ((password == null) ? "" : ":" + password);
  String hostname = new String(getRawHost());
  String hostport = (_port == -1) ? hostname : hostname + ":" + _port;
  String authority = userinfo + "@" + hostport;
  _userinfo = userinfo.toCharArray();
  _authority = authority.toCharArray();
  setURI();
}

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

/**
 * Set the raw-escaped user and password.
 *
 * @param escapedUser the raw-escaped user
 * @param escapedPassword the raw-escaped password; could be null
 * @throws URIException escaped user not valid or user required; escaped
 * password not valid or username missed
 */
public void setRawUserinfo(char[] escapedUser, char[] escapedPassword)
  throws URIException {
  if (escapedUser == null || escapedUser.length == 0) {
    throw new URIException(URIException.PARSING, "user required");
  }
  if (!validate(escapedUser, within_userinfo) 
    || ((escapedPassword != null) 
    && !validate(escapedPassword, within_userinfo))) {
    throw new URIException(URIException.ESCAPING,
        "escaped userinfo not valid");
  }
  String username = new String(escapedUser);
  String password = (escapedPassword == null) 
    ? null : new String(escapedPassword);
  String userinfo = username + ((password == null) ? "" : ":" + password);
  String hostname = new String(getRawHost());
  String hostport = (_port == -1) ? hostname : hostname + ":" + _port;
  String authority = userinfo + "@" + hostport;
  _userinfo = userinfo.toCharArray();
  _authority = authority.toCharArray();
  setURI();
}

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

/**
 * Set the raw-escaped user and password.
 *
 * @param escapedUser the raw-escaped user
 * @param escapedPassword the raw-escaped password; could be null
 * @throws URIException escaped user not valid or user required; escaped
 * password not valid or username missed
 */
public void setRawUserinfo(char[] escapedUser, char[] escapedPassword)
  throws URIException {
  if (escapedUser == null || escapedUser.length == 0) {
    throw new URIException(URIException.PARSING, "user required");
  }
  if (!validate(escapedUser, within_userinfo) 
    || ((escapedPassword != null) 
    && !validate(escapedPassword, within_userinfo))) {
    throw new URIException(URIException.ESCAPING,
        "escaped userinfo not valid");
  }
  String username = new String(escapedUser);
  String password = (escapedPassword == null) 
    ? null : new String(escapedPassword);
  String userinfo = username + ((password == null) ? "" : ":" + password);
  String hostname = new String(getRawHost());
  String hostport = (_port == -1) ? hostname : hostname + ":" + _port;
  String authority = userinfo + "@" + hostport;
  _userinfo = userinfo.toCharArray();
  _authority = authority.toCharArray();
  setURI();
}

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

/**
 * Set the raw-escaped user and password.
 *
 * @param escapedUser the raw-escaped user
 * @param escapedPassword the raw-escaped password; could be null
 * @throws URIException escaped user not valid or user required; escaped
 * password not valid or username missed
 */
public void setRawUserinfo(char[] escapedUser, char[] escapedPassword)
  throws URIException {
  if (escapedUser == null || escapedUser.length == 0) {
    throw new URIException(URIException.PARSING, "user required");
  }
  if (!validate(escapedUser, within_userinfo) 
    || ((escapedPassword != null) 
    && !validate(escapedPassword, within_userinfo))) {
    throw new URIException(URIException.ESCAPING,
        "escaped userinfo not valid");
  }
  String username = new String(escapedUser);
  String password = (escapedPassword == null) 
    ? null : new String(escapedPassword);
  String userinfo = username + ((password == null) ? "" : ":" + password);
  String hostname = new String(getRawHost());
  String hostport = (_port == -1) ? hostname : hostname + ":" + _port;
  String authority = userinfo + "@" + hostport;
  _userinfo = userinfo.toCharArray();
  _authority = authority.toCharArray();
  setURI();
}

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

/**
 * Set the raw-escaped user and password.
 *
 * @param escapedUser the raw-escaped user
 * @param escapedPassword the raw-escaped password; could be null
 * @throws URIException escaped user not valid or user required; escaped
 * password not valid or username missed
 */
public void setRawUserinfo(char[] escapedUser, char[] escapedPassword)
  throws URIException {
  if (escapedUser == null || escapedUser.length == 0) {
    throw new URIException(URIException.PARSING, "user required");
  }
  if (!validate(escapedUser, within_userinfo) 
    || ((escapedPassword != null) 
    && !validate(escapedPassword, within_userinfo))) {
    throw new URIException(URIException.ESCAPING,
        "escaped userinfo not valid");
  }
  String username = new String(escapedUser);
  String password = (escapedPassword == null) 
    ? null : new String(escapedPassword);
  String userinfo = username + ((password == null) ? "" : ":" + password);
  String hostname = new String(getRawHost());
  String hostport = (_port == -1) ? hostname : hostname + ":" + _port;
  String authority = userinfo + "@" + hostport;
  _userinfo = userinfo.toCharArray();
  _authority = authority.toCharArray();
  setURI();
}

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

/**
 * Set the raw-escaped password.
 *
 * @param escapedPassword the raw-escaped password; could be null
 * @throws URIException escaped password not valid or username missed
 */
public void setRawPassword(char[] escapedPassword) throws URIException {
  if (escapedPassword != null 
    && !validate(escapedPassword, within_userinfo)) {
    throw new URIException(URIException.ESCAPING,
      "escaped password not valid");
  }
  if (getRawUser() == null || getRawUser().length == 0) {
    throw new URIException(URIException.PARSING, "username required");
  }
  String username = new String(getRawUser());
  String password = escapedPassword == null ? null : new String(escapedPassword);
  // an emtpy string is allowed as a password
  String userinfo = username + ((password == null) ? "" : ":" + password);
  String hostname = new String(getRawHost());
  String hostport = (_port == -1) ? hostname : hostname + ":" + _port;
  String authority = userinfo + "@" + hostport;
  _userinfo = userinfo.toCharArray();
  _authority = authority.toCharArray();
  setURI();
}

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

/**
 * Set the raw-escaped password.
 *
 * @param escapedPassword the raw-escaped password; could be null
 * @throws URIException escaped password not valid or username missed
 */
public void setRawPassword(char[] escapedPassword) throws URIException {
  if (escapedPassword != null 
    && !validate(escapedPassword, within_userinfo)) {
    throw new URIException(URIException.ESCAPING,
      "escaped password not valid");
  }
  if (getRawUser() == null || getRawUser().length == 0) {
    throw new URIException(URIException.PARSING, "username required");
  }
  String username = new String(getRawUser());
  String password = escapedPassword == null ? null : new String(escapedPassword);
  // an emtpy string is allowed as a password
  String userinfo = username + ((password == null) ? "" : ":" + password);
  String hostname = new String(getRawHost());
  String hostport = (_port == -1) ? hostname : hostname + ":" + _port;
  String authority = userinfo + "@" + hostport;
  _userinfo = userinfo.toCharArray();
  _authority = authority.toCharArray();
  setURI();
}

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

/**
 * Set the raw-escaped password.
 *
 * @param escapedPassword the raw-escaped password; could be null
 * @throws URIException escaped password not valid or username missed
 */
public void setRawPassword(char[] escapedPassword) throws URIException {
  if (escapedPassword != null 
    && !validate(escapedPassword, within_userinfo)) {
    throw new URIException(URIException.ESCAPING,
      "escaped password not valid");
  }
  if (getRawUser() == null || getRawUser().length == 0) {
    throw new URIException(URIException.PARSING, "username required");
  }
  String username = new String(getRawUser());
  String password = escapedPassword == null ? null : new String(escapedPassword);
  // an emtpy string is allowed as a password
  String userinfo = username + ((password == null) ? "" : ":" + password);
  String hostname = new String(getRawHost());
  String hostport = (_port == -1) ? hostname : hostname + ":" + _port;
  String authority = userinfo + "@" + hostport;
  _userinfo = userinfo.toCharArray();
  _authority = authority.toCharArray();
  setURI();
}

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

/**
 * Set the raw-escaped password.
 *
 * @param escapedPassword the raw-escaped password; could be null
 * @throws URIException escaped password not valid or username missed
 */
public void setRawPassword(char[] escapedPassword) throws URIException {
  if (escapedPassword != null 
    && !validate(escapedPassword, within_userinfo)) {
    throw new URIException(URIException.ESCAPING,
      "escaped password not valid");
  }
  if (getRawUser() == null || getRawUser().length == 0) {
    throw new URIException(URIException.PARSING, "username required");
  }
  String username = new String(getRawUser());
  String password = escapedPassword == null ? null : new String(escapedPassword);
  // an emtpy string is allowed as a password
  String userinfo = username + ((password == null) ? "" : ":" + password);
  String hostname = new String(getRawHost());
  String hostport = (_port == -1) ? hostname : hostname + ":" + _port;
  String authority = userinfo + "@" + hostport;
  _userinfo = userinfo.toCharArray();
  _authority = authority.toCharArray();
  setURI();
}

相关文章