ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r1079430 - in /ant/core/trunk: WHATSNEW src/main/org/apache/tools/ant/taskdefs/optional/splash/SplashTask.java
Date Tue, 08 Mar 2011 16:49:17 GMT
Author: bodewig
Date: Tue Mar  8 16:49:16 2011
New Revision: 1079430

URL: http://svn.apache.org/viewvc?rev=1079430&view=rev
Log:
use setproxy inside splash in order to fix PR 50888

Modified:
    ant/core/trunk/WHATSNEW
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/splash/SplashTask.java

Modified: ant/core/trunk/WHATSNEW
URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=1079430&r1=1079429&r2=1079430&view=diff
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Tue Mar  8 16:49:16 2011
@@ -20,6 +20,11 @@ Fixed bugs:
  * Delete task example does not work
    Bugzilla Report 50816.  
 
+ * <splash>'s proxy handling has been delegated to <setproxy>
+   internally so the two tasks are consistent.  <splash>'s way of not
+   setting a proxy caused problems with other Java libraries.
+   Bugzilla Report 50888.
+
 Other changes:
 --------------
 

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/splash/SplashTask.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/splash/SplashTask.java?rev=1079430&r1=1079429&r2=1079430&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/splash/SplashTask.java
(original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/splash/SplashTask.java
Tue Mar  8 16:49:16 2011
@@ -29,6 +29,7 @@ import org.apache.tools.ant.BuildExcepti
 import org.apache.tools.ant.Project;
 import org.apache.tools.ant.Task;
 import org.apache.tools.ant.util.Base64Converter;
+import org.apache.tools.ant.taskdefs.optional.net.SetProxy;
 
 /**
  * Creates a splash screen. The splash screen is displayed
@@ -66,7 +67,7 @@ public class SplashTask extends Task {
      * using &lt;setproxy&gt; instead
      * @param useProxy if ture, enable proxy settings
      * @deprecated since 1.5.x.
-     *             Use org.apache.tools.ant.taskdefs.optional.SetProxy
+     *             Use org.apache.tools.ant.taskdefs.optional.net.SetProxy
      */
     public void setUseproxy(boolean useProxy) {
         this.useProxy = useProxy;
@@ -75,6 +76,8 @@ public class SplashTask extends Task {
     /**
      * name of proxy; optional.
      * @param proxy the name of the proxy host
+     * @deprecated since 1.5.x.
+     *             Use org.apache.tools.ant.taskdefs.optional.net.SetProxy
      */
     public void setProxy(String proxy) {
         this.proxy = proxy;
@@ -83,6 +86,8 @@ public class SplashTask extends Task {
     /**
      * Proxy port; optional, default 80.
      * @param port the proxy port
+     * @deprecated since 1.5.x.
+     *             Use org.apache.tools.ant.taskdefs.optional.net.SetProxy
      */
     public void setPort(String port) {
         this.port = port;
@@ -91,6 +96,8 @@ public class SplashTask extends Task {
     /**
      * Proxy user; optional, default =none.
      * @param user the proxy user
+     * @deprecated since 1.5.x.
+     *             Use org.apache.tools.ant.taskdefs.optional.net.SetProxy
      */
     public void setUser(String user) {
         this.user = user;
@@ -99,6 +106,8 @@ public class SplashTask extends Task {
     /**
      * Proxy password; required if <tt>user</tt> is set.
      * @param password the proxy password
+     * @deprecated since 1.5.x.
+     *             Use org.apache.tools.ant.taskdefs.optional.net.SetProxy
      */
     public void setPassword(String password) {
         this.password = password;
@@ -156,13 +165,20 @@ public class SplashTask extends Task {
             try {
                 URLConnection conn = null;
 
+                SetProxy sp = new SetProxy();
+                sp.setProxyHost(proxy);
+                if (port != null) {
+                    sp.setProxyPort(Integer.parseInt(port));
+                }
+                sp.setProxyUser(user);
+                sp.setProxyPassword(password);
+                sp.applyWebProxySettings();
+
                 if (useProxy && (proxy != null && proxy.length() > 0)
                     && (port != null && port.length() > 0)) {
 
                     log("Using proxied Connection",  Project.MSG_DEBUG);
                     System.getProperties().put("http.proxySet", "true");
-                    System.getProperties().put("http.proxyHost", proxy);
-                    System.getProperties().put("http.proxyPort", port);
 
                     URL url = new URL(imgurl);
 
@@ -179,8 +195,6 @@ public class SplashTask extends Task {
 
                 } else {
                     System.getProperties().put("http.proxySet", "false");
-                    System.getProperties().put("http.proxyHost", "");
-                    System.getProperties().put("http.proxyPort", "");
                     log("Using Direction HTTP Connection", Project.MSG_DEBUG);
                     URL url = new URL(imgurl);
                     conn = url.openConnection();



Mime
View raw message