camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r751231 - in /camel/trunk/components: camel-ftp/src/main/java/org/apache/camel/component/file/remote/ camel-ftp/src/test/java/org/apache/camel/component/file/remote/ camel-spring/src/test/resources/org/apache/camel/spring/processor/idempotent/
Date Sat, 07 Mar 2009 09:42:32 GMT
Author: davsclaus
Date: Sat Mar  7 09:42:32 2009
New Revision: 751231

URL: http://svn.apache.org/viewvc?rev=751231&view=rev
Log:
CAMEL-1428: Problem with SFTP on XP using move and using no starting directory configured
on endpoint.

Modified:
    camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileConfiguration.java
    camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/UriConfigurationTest.java
    camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/idempotent/fileConsumerIdempotentTest.xml

Modified: camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileConfiguration.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileConfiguration.java?rev=751231&r1=751230&r2=751231&view=diff
==============================================================================
--- camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileConfiguration.java
(original)
+++ camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileConfiguration.java
Sat Mar  7 09:42:32 2009
@@ -54,6 +54,17 @@
         setPort(uri.getPort());
     }
 
+    @Override
+    public void setDirectory(String directory) {
+        // let super do its work first
+        super.setDirectory(directory);
+
+        // for FTP we must not start with a / root, so skip it if its there
+        if (getDirectory().startsWith("/")) {
+            setDirectory(getDirectory().substring(1));
+        }
+    }
+
     /**
      * Returns human readable server information for logging purpose
      */

Modified: camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/UriConfigurationTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/UriConfigurationTest.java?rev=751231&r1=751230&r2=751231&view=diff
==============================================================================
--- camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/UriConfigurationTest.java
(original)
+++ camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/UriConfigurationTest.java
Sat Mar  7 09:42:32 2009
@@ -85,14 +85,22 @@
     }
 
     public void testRemoteFileEndpointFiles() {
-        assertRemoteFileEndpointFile("ftp://hostname/foo/bar", "/foo/bar");
-        assertRemoteFileEndpointFile("ftp://hostname/foo/", "/foo/");
-        assertRemoteFileEndpointFile("ftp://hostname/foo", "/foo");
-        assertRemoteFileEndpointFile("ftp://hostname/", "/");
+        assertRemoteFileEndpointFile("ftp://hostname/foo/bar", "foo/bar");
+        assertRemoteFileEndpointFile("ftp://hostname/foo/", "foo/");
+        assertRemoteFileEndpointFile("ftp://hostname/foo", "foo");
+        assertRemoteFileEndpointFile("ftp://hostname/", "");
         assertRemoteFileEndpointFile("ftp://hostname", "");
-        assertRemoteFileEndpointFile("ftp://hostname//", "//");
-        assertRemoteFileEndpointFile("ftp://hostname//foo/bar", "//foo/bar");
-        assertRemoteFileEndpointFile("sftp://user@hostname:123//foo/bar?password=secret",
"//foo/bar");
+        assertRemoteFileEndpointFile("ftp://hostname//", "");
+        assertRemoteFileEndpointFile("ftp://hostname//foo/bar", "foo/bar");
+        assertRemoteFileEndpointFile("sftp://user@hostname:123//foo/bar?password=secret",
"foo/bar");
+        assertRemoteFileEndpointFile("sftp://user@hostname:123?password=secret", "");
+        assertRemoteFileEndpointFile("sftp://hostname/foo/bar", "foo/bar");
+        assertRemoteFileEndpointFile("sftp://hostname/foo/", "foo/");
+        assertRemoteFileEndpointFile("sftp://hostname/foo", "foo");
+        assertRemoteFileEndpointFile("sftp://hostname/", "");
+        assertRemoteFileEndpointFile("sftp://hostname", "");
+        assertRemoteFileEndpointFile("sftp://hostname//", "");
+        assertRemoteFileEndpointFile("sftp://hostname//foo/bar", "foo/bar");
     }
 
     private void assertRemoteFileEndpointFile(String endpointUri, String expectedFile) {

Modified: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/idempotent/fileConsumerIdempotentTest.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/idempotent/fileConsumerIdempotentTest.xml?rev=751231&r1=751230&r2=751231&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/idempotent/fileConsumerIdempotentTest.xml
(original)
+++ camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/idempotent/fileConsumerIdempotentTest.xml
Sat Mar  7 09:42:32 2009
@@ -36,7 +36,7 @@
 
     <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
         <route>
-            <from uri="file://target/fileidempotent/?idempotent=true&amp;idempotentRepository=#fileStore&amp;moveExpression=done/${file:name}"/>
+            <from uri="file://target/fileidempotent/?idempotent=true&amp;idempotentRepository=#fileStore&amp;move=done/${file:name}"/>
             <to uri="mock:result"/>
         </route>
     </camelContext>



Mime
View raw message