org.codehaus.cargo.container.installer.ZipURLInstaller.setProxy()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(2.8k)|赞(0)|评价(0)|浏览(76)

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

ZipURLInstaller.setProxy介绍

[英]Sets proxy details.
[中]设置代理详细信息。

代码示例

代码示例来源:origin: codehaus-cargo/cargo

/**
 * Creates the {@link ZipURLInstaller} with the appropriate configuration.
 * @param projectBuildDirectory Project build directory.
 * @return a new instance of {@link ZipURLInstaller} configured using the attributes specified
 * by the user
 */
public ZipURLInstaller createInstaller(String projectBuildDirectory)
{
  String extractDir = getExtractDir();
  if (extractDir == null)
  {
    extractDir = new File(projectBuildDirectory, EXTRACT_SUBDIRECTORY).getPath();
  }
  ZipURLInstaller installer = new ZipURLInstaller(getUrl(), getDownloadDir(), extractDir);
  if (getProxy() != null)
  {
    installer.setProxy(getProxy());
  }
  return installer;
}

代码示例来源:origin: org.codehaus.cargo/cargo-ant

/**
   * @return a new instance of {@link ZipURLInstaller} configured using the attributes specified
   * by the user
   */
  public ZipURLInstaller createInstaller()
  {
    ZipURLInstaller installer = new ZipURLInstaller(getInstallURL(), getDownloadDir(),
      getExtractDir());
    if (getProxy() != null)
    {
      installer.setProxy(getProxy());
    }
    return installer;
  }
}

代码示例来源:origin: codehaus-cargo/cargo

/**
   * @return a new instance of {@link ZipURLInstaller} configured using the attributes specified
   * by the user
   */
  public ZipURLInstaller createInstaller()
  {
    ZipURLInstaller installer = new ZipURLInstaller(getInstallURL(), getDownloadDir(),
      getExtractDir());
    if (getProxy() != null)
    {
      installer.setProxy(getProxy());
    }
    return installer;
  }
}

代码示例来源:origin: codehaus-cargo/cargo

/**
 * Test {@link ZipURLInstaller#install()} successful with a proxy.
 * @throws Exception If anything goes wrong.
 */
public void testSuccessfulDownloadWhenProxySet() throws Exception
{
  this.installer.setAntTaskFactory(
    new AntTaskFactory()
    {
      @Override
      public Task createTask(String taskName)
      {
        return new HarmlessGet();
      }
    });
  Proxy proxy = new Proxy();
  proxy.setHost("proxyhost");
  this.installer.setProxy(proxy);
  this.installer.download();
  assertEquals(System.getProperty("http.proxyHost"), proxy.getHost());
}

代码示例来源:origin: codehaus-cargo/cargo

Proxy proxy = new Proxy();
proxy.setHost("proxyhost");
this.installer.setProxy(proxy);

代码示例来源:origin: codehaus-cargo/cargo

/**
   * Install container using {@link ZipURLInstaller}.
   * @return Location in which the container has been installed.
   */
  private String installContainer()
  {
    ZipURLInstaller installer = new ZipURLInstaller(getTestData().installURL,
      getTestData().downloadDir, getTestData().extractDir);
    installer.setLogger(getLogger());

    // Set up proxy
    if (getTestData().proxy != null)
    {
      Proxy userProxy = getTestData().proxy;
      userProxy.setLogger(getLogger());
      installer.setProxy(userProxy);
    }
    installer.install();

    return installer.getHome();
  }
}

相关文章