maven-wagon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r662431 - in /maven/wagon/trunk/wagon-providers/wagon-ssh/src: main/java/org/apache/maven/wagon/providers/ssh/jsch/ test/java/org/apache/maven/wagon/providers/ssh/jsch/
Date Mon, 02 Jun 2008 13:43:12 GMT
Author: brett
Date: Mon Jun  2 06:43:11 2008
New Revision: 662431

URL: http://svn.apache.org/viewvc?rev=662431&view=rev
Log:
[WAGON-xxx] support getIfNewer in scp wagon

Modified:
    maven/wagon/trunk/wagon-providers/wagon-ssh/src/main/java/org/apache/maven/wagon/providers/ssh/jsch/ScpWagon.java
    maven/wagon/trunk/wagon-providers/wagon-ssh/src/test/java/org/apache/maven/wagon/providers/ssh/jsch/ScpWagonTest.java
    maven/wagon/trunk/wagon-providers/wagon-ssh/src/test/java/org/apache/maven/wagon/providers/ssh/jsch/ScpWagonWithSshPrivateKeySearchTest.java

Modified: maven/wagon/trunk/wagon-providers/wagon-ssh/src/main/java/org/apache/maven/wagon/providers/ssh/jsch/ScpWagon.java
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-providers/wagon-ssh/src/main/java/org/apache/maven/wagon/providers/ssh/jsch/ScpWagon.java?rev=662431&r1=662430&r2=662431&view=diff
==============================================================================
--- maven/wagon/trunk/wagon-providers/wagon-ssh/src/main/java/org/apache/maven/wagon/providers/ssh/jsch/ScpWagon.java
(original)
+++ maven/wagon/trunk/wagon-providers/wagon-ssh/src/main/java/org/apache/maven/wagon/providers/ssh/jsch/ScpWagon.java
Mon Jun  2 06:43:11 2008
@@ -225,7 +225,7 @@
         Resource resource = inputData.getResource();
         
         String path = getPath( getRepository().getBasedir(), resource.getName() );
-        String cmd = "scp -f " + path;
+        String cmd = "scp -p -f " + path;
 
         fireTransferDebug( "Executing command: " + cmd );
 
@@ -247,10 +247,16 @@
 
             int exitCode = in.read();
 
-            if ( exitCode == 'P' )
+            if ( exitCode == 'T' )
             {
-                // ignore modification times
+                String line = readLine( in );
+                
+                String[] times = line.split( " " );
+                
+                resource.setLastModified( Long.valueOf( times[0] ).longValue() * 1000 );
 
+                sendEom( channelOutputStream );
+                
                 exitCode = in.read();
             }
 

Modified: maven/wagon/trunk/wagon-providers/wagon-ssh/src/test/java/org/apache/maven/wagon/providers/ssh/jsch/ScpWagonTest.java
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-providers/wagon-ssh/src/test/java/org/apache/maven/wagon/providers/ssh/jsch/ScpWagonTest.java?rev=662431&r1=662430&r2=662431&view=diff
==============================================================================
--- maven/wagon/trunk/wagon-providers/wagon-ssh/src/test/java/org/apache/maven/wagon/providers/ssh/jsch/ScpWagonTest.java
(original)
+++ maven/wagon/trunk/wagon-providers/wagon-ssh/src/test/java/org/apache/maven/wagon/providers/ssh/jsch/ScpWagonTest.java
Mon Jun  2 06:43:11 2008
@@ -34,11 +34,6 @@
 public class ScpWagonTest
     extends StreamingWagonTestCase
 {
-    protected boolean supportsGetIfNewer()
-    {
-        return false;
-    }
-
     protected String getProtocol()
     {
         return "scp";
@@ -69,7 +64,7 @@
 
     protected long getExpectedLastModifiedOnGet( Repository repository, Resource resource
)
     {
-        return 0;
+        return new File( repository.getBasedir(), resource.getName() ).lastModified();
     }
 
 }

Modified: maven/wagon/trunk/wagon-providers/wagon-ssh/src/test/java/org/apache/maven/wagon/providers/ssh/jsch/ScpWagonWithSshPrivateKeySearchTest.java
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-providers/wagon-ssh/src/test/java/org/apache/maven/wagon/providers/ssh/jsch/ScpWagonWithSshPrivateKeySearchTest.java?rev=662431&r1=662430&r2=662431&view=diff
==============================================================================
--- maven/wagon/trunk/wagon-providers/wagon-ssh/src/test/java/org/apache/maven/wagon/providers/ssh/jsch/ScpWagonWithSshPrivateKeySearchTest.java
(original)
+++ maven/wagon/trunk/wagon-providers/wagon-ssh/src/test/java/org/apache/maven/wagon/providers/ssh/jsch/ScpWagonWithSshPrivateKeySearchTest.java
Mon Jun  2 06:43:11 2008
@@ -19,6 +19,8 @@
  * under the License.
  */
 
+import java.io.File;
+
 import org.apache.maven.wagon.StreamingWagonTestCase;
 import org.apache.maven.wagon.authentication.AuthenticationInfo;
 import org.apache.maven.wagon.providers.ssh.TestData;
@@ -32,11 +34,6 @@
 public class ScpWagonWithSshPrivateKeySearchTest
     extends StreamingWagonTestCase
 {
-    protected boolean supportsGetIfNewer()
-    {
-        return false;
-    }
-
     protected String getProtocol()
     {
         return "scp";
@@ -47,7 +44,6 @@
         return TestData.getTestRepositoryUrl();
     }
 
-
     protected AuthenticationInfo getAuthInfo()
     {
         AuthenticationInfo authInfo = super.getAuthInfo();
@@ -61,6 +57,6 @@
 
     protected long getExpectedLastModifiedOnGet( Repository repository, Resource resource
)
     {
-        return 0;
+        return new File( repository.getBasedir(), resource.getName() ).lastModified();
     }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: wagon-commits-unsubscribe@maven.apache.org
For additional commands, e-mail: wagon-commits-help@maven.apache.org


Mime
View raw message