ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maart...@apache.org
Subject svn commit: r658842 - /ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/Scp.java
Date Wed, 21 May 2008 20:16:20 GMT
Author: maartenc
Date: Wed May 21 13:16:20 2008
New Revision: 658842

URL: http://svn.apache.org/viewvc?rev=658842&view=rev
Log:
Allow the mode to be null.

Modified:
    ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/Scp.java

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/Scp.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/Scp.java?rev=658842&r1=658841&r2=658842&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/Scp.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/Scp.java Wed May 21
13:16:20 2008
@@ -482,20 +482,22 @@
             throws IOException, RemoteScpException {
         ChannelExec channel = null;
 
-        if ((localFile == null) || (remoteTargetName == null) || (mode == null)) {
+        if ((localFile == null) || (remoteTargetName == null)) {
             throw new IllegalArgumentException("Null argument.");
         }
 
-        if (mode.length() != MODE_LENGTH) {
-            throw new IllegalArgumentException("Invalid mode.");
-        }
-
-        for (int i = 0; i < mode.length(); i++) {
-            if (!Character.isDigit(mode.charAt(i))) {
+        if (mode != null) {
+            if (mode.length() != MODE_LENGTH) {
                 throw new IllegalArgumentException("Invalid mode.");
             }
+    
+            for (int i = 0; i < mode.length(); i++) {
+                if (!Character.isDigit(mode.charAt(i))) {
+                    throw new IllegalArgumentException("Invalid mode.");
+                }
+            }
         }
-
+        
         String cmd = "scp -t ";
         if (mode != null) {
             cmd = cmd + "-p ";



Mime
View raw message