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

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

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

HttpURL.setUserinfo介绍

[英]Set the user and password.
[中]设置用户和密码。

代码示例

代码示例来源:origin: slide/slide-webdavlib

/**
 * Set the userinfo part of this WebdavResource.
 *
 * @exception HttpException
 * @exception IOException
 * @see #setHttpURL(HttpURL)
 * @see #setHttpURL(java.lang.String)
 * @see #setPath(java.lang.String)
 */
public void setUserInfo(String userName, String password)
  throws HttpException, IOException {
  httpURL.setUserinfo(userName, password);
  setHttpURL(httpURL);
}

代码示例来源:origin: slide/slide-webdavlib

url.setUserinfo(username, password);
files[i] = new WebdavFile(url, this.rootURL);

代码示例来源:origin: slide/slide-webdavlib

WebdavFile.davSeparator + newFolderString);
url.setUserinfo(username, password);
newFolder = new WebdavFile(url, this.rootURL);

代码示例来源:origin: slide/slide-webdavlib

public WebdavSystemView(String uri, String rootPath, String username,
            String password)
  throws IllegalAccessError, URIException, IOException {
  try {
    this.rootURL = this.uriToHttpURL(uri + rootPath);
    this.uri = uri;
    this.rootURL.setUserinfo(username, password);
    this.username = username;
    this.password = password;
    this.rootPath = rootPath;
    this.connect();
    //System.out.println("Connected successfully to  : " + this.rootURL);
    this.disconnect();
    // Create home directory object
    this.homedir = new WebdavFile(this.rootURL, this.rootURL);
    //System.out.println("Homedir : " + this.homedir);
  } catch (IllegalAccessError e) {
    System.err.println(e.toString());
    e.printStackTrace();
    throw e;
  } catch (URIException e) {
    System.err.println(e.toString());
    e.printStackTrace();
    throw e;
  } catch (IOException e) {
    System.err.println(e.toString());
    e.printStackTrace();
    throw e;
  }
}

代码示例来源:origin: org.apache.maven.wagon/wagon-webdav

httpURL.setUserinfo( userName, password );

相关文章