You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by ma...@apache.org on 2008/05/21 22:16:20 UTC

svn commit: r658842 - /ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/Scp.java

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 ";