hivemind-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <>
Subject [Jakarta-hivemind Wiki] Update of "ProxySupport" by ledents
Date Tue, 07 Jun 2005 10:03:05 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Jakarta-hivemind Wiki" for change

The following page has been changed by ledents:

New page:
#pragma section-numbers off

= Problem Description =

As of this writing (June 07 2005), the build process fails to download dependency files being
behind firewall (proxy server).

= Solution =

However a small modification to <> and <dependency.xml> files circumvent
this problem.

== changes ==

We need to add support for configuring the following attributes '''proxyHost''', '''proxyPort''',
'''proxyUser''' and

The ''setProxyHost()'' method simply sets the '''"http.proxyHost"''' system property.

The ''setProxyPort()'' method simply sets the '''"http.proxyPort"''' system property.

The ''setProxyUser()'' and ''setProxyPwd()'' updates instance ''_proxyUser'' and ''_proxyPwd''
instance variables which are
used in the ''execute()'' method to attach a "Proxy-Authorization" request property to the



            URLConnection connection = _src.openConnection();

            if (_proxyUser != null)
                sun.misc.BASE64Encoder encoder = new sun.misc.BASE64Encoder();
                String encoded = encoder.encode(
                            new String(_proxyUser + ":" + _proxyPwd).getBytes());
                connection.setRequestProperty("Proxy-Authorization", "Basic " + encoded);


        catch (IOException ex)
            log("Failure accessing " + _src + ": " + ex.getMessage(), Project.MSG_ERR);


== dependency.xml changes ==

the ''grab-file'' macro should define 4 additional attributes '''proxyHost''', '''proxyPort''',
'''proxyUser''' and
'''proxyPwd''' whith configured defaults which may be empty properties in the
file or idealy
references user configurable properties !! 

  <macrodef name="grab-file">
    <attribute name="src" description="The URL of the file to download."/>

    <attribute name="dest" description="The directory and file to copy to."/>

    <attribute name="proxyHost" default="${}" description="The proxy hostname
or ip address to used"/>

    <attribute name="proxyPort" default="${proxy.port}" description="The proxy port to

    <attribute name="proxyUser" default="${proxy.user}" description="The user used to log
onto the proxy"/>

    <attribute name="proxyPwd"  default="${proxy.pwd}" description="The password used to
log onto the proxy"/>


      <mkdir dir="${hivebuild.classes.dir}"/>

      <javac includeantruntime="yes"

        <taskdef classname="" name="grabber" classpathref="grabber.classpath"/>

        <grabber src="@{src}" dest="@{dest}" proxyHost="@{proxyHost}" proxyPort="@{proxyPort}"
                proxyUser="@{proxyUser}" proxyPwd="@{proxyPwd}"/>




To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message