ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject git commit: PR 56678 allow tsa proxy host to be used without tsaurl in signjar
Date Sat, 12 Jul 2014 05:22:21 GMT
Repository: ant
Updated Branches:
  refs/heads/master 37a64a407 -> ba170891d


PR 56678 allow tsa proxy host to be used without tsaurl in signjar


Project: http://git-wip-us.apache.org/repos/asf/ant/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/ba170891
Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/ba170891
Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/ba170891

Branch: refs/heads/master
Commit: ba170891db5e5a75d02391a73085dee6e7a6074d
Parents: 37a64a4
Author: Stefan Bodewig <bodewig@apache.org>
Authored: Sat Jul 12 07:21:55 2014 +0200
Committer: Stefan Bodewig <bodewig@apache.org>
Committed: Sat Jul 12 07:21:55 2014 +0200

----------------------------------------------------------------------
 .../org/apache/tools/ant/taskdefs/SignJar.java  | 31 ++++++++++----------
 1 file changed, 16 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant/blob/ba170891/src/main/org/apache/tools/ant/taskdefs/SignJar.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/SignJar.java b/src/main/org/apache/tools/ant/taskdefs/SignJar.java
index a15df4f..f971001 100644
--- a/src/main/org/apache/tools/ant/taskdefs/SignJar.java
+++ b/src/main/org/apache/tools/ant/taskdefs/SignJar.java
@@ -549,21 +549,6 @@ public class SignJar extends AbstractJarSignerTask {
         if (tsaurl != null) {
             addValue(cmd, "-tsa");
             addValue(cmd, tsaurl);
-
-            if (tsaproxyhost != null) {
-                final String connectionType;
-                if (tsaurl.startsWith("https")) {
-                    connectionType = "https";
-                } else {
-                    connectionType = "http";
-                }
-
-                addValue(cmd, "-J-D" + connectionType + ".proxyHost=" + tsaproxyhost);
-
-                if (tsaproxyport != null) {
-                    addValue(cmd, "-J-D" + connectionType + ".proxyPort=" + tsaproxyport);
-                }
-            }
         }
 
         if (tsacert != null) {
@@ -571,6 +556,14 @@ public class SignJar extends AbstractJarSignerTask {
             addValue(cmd, tsacert);
         }
 
+        if (tsaproxyhost != null) {
+            if (tsaurl == null || tsaurl.startsWith("https")) {
+                addProxyFor(cmd, "https");
+            }
+            if (tsaurl == null || !tsaurl.startsWith("https")) {
+                addProxyFor(cmd, "http");
+            }
+        }
     }
 
     /**
@@ -641,4 +634,12 @@ public class SignJar extends AbstractJarSignerTask {
     public void setPreserveLastModified(boolean preserveLastModified) {
         this.preserveLastModified = preserveLastModified;
     }
+
+    private void addProxyFor(final ExecTask cmd, final String scheme) {
+        addValue(cmd, "-J-D" + scheme + ".proxyHost=" + tsaproxyhost);
+
+        if (tsaproxyport != null) {
+            addValue(cmd, "-J-D" + scheme + ".proxyPort=" + tsaproxyport);
+        }
+    }
 }


Mime
View raw message