Repository: camel
Updated Branches:
  refs/heads/master db32eb92a -> 41a6b93eb


CAMEL-8038: Fixed @UriPath


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

Branch: refs/heads/master
Commit: 39010f4e69e41570b804c7e269ab8fc1ba2ece9d
Parents: db32eb9
Author: Claus Ibsen <davscl...@apache.org>
Authored: Mon Nov 24 12:28:51 2014 +0100
Committer: Claus Ibsen <davscl...@apache.org>
Committed: Tue Nov 25 06:56:41 2014 +0100

----------------------------------------------------------------------
 .../camel/component/file/remote/FtpEndpoint.java     |  6 ++++--
 .../camel/component/file/remote/SftpEndpoint.java    | 15 ++++++++++++++-
 ...tpComponentConfigurationAndDocumentationTest.java |  2 ++
 ...psComponentConfigurationAndDocumentationTest.java |  2 ++
 4 files changed, 22 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/39010f4e/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpEndpoint.java
----------------------------------------------------------------------
diff --git 
a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpEndpoint.java
 
b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpEndpoint.java
index 34dd53f..674e306 100644
--- 
a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpEndpoint.java
+++ 
b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpEndpoint.java
@@ -42,6 +42,8 @@ public class FtpEndpoint<T extends FTPFile> extends 
RemoteFileEndpoint<FTPFile>
     protected Map<String, Object> ftpClientParameters;
     protected Map<String, Object> ftpClientConfigParameters;
     @UriParam
+    protected FtpConfiguration configuration;
+    @UriParam
     protected int soTimeout;
     @UriParam
     protected int dataTimeout;
@@ -141,7 +143,7 @@ public class FtpEndpoint<T extends FTPFile> extends 
RemoteFileEndpoint<FTPFile>
         if (configuration == null) {
             configuration = new FtpConfiguration();
         }
-        return (FtpConfiguration)configuration;
+        return configuration;
     }
 
     @Override
@@ -149,7 +151,7 @@ public class FtpEndpoint<T extends FTPFile> extends 
RemoteFileEndpoint<FTPFile>
         if (configuration == null) {
             throw new IllegalArgumentException("FtpConfiguration expected");
         }
-        this.configuration = configuration;
+        this.configuration = (FtpConfiguration) configuration;
     }
 
     public FTPClient getFtpClient() {

http://git-wip-us.apache.org/repos/asf/camel/blob/39010f4e/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpEndpoint.java
----------------------------------------------------------------------
diff --git 
a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpEndpoint.java
 
b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpEndpoint.java
index e7f7591..c834d4f 100644
--- 
a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpEndpoint.java
+++ 
b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpEndpoint.java
@@ -19,8 +19,10 @@ package org.apache.camel.component.file.remote;
 import com.jcraft.jsch.ChannelSftp;
 import com.jcraft.jsch.Proxy;
 import org.apache.camel.Processor;
+import org.apache.camel.component.file.GenericFileConfiguration;
 import org.apache.camel.component.file.GenericFileProducer;
 import org.apache.camel.spi.UriEndpoint;
+import org.apache.camel.spi.UriParam;
 
 /**
  * Secure FTP endpoint
@@ -28,6 +30,9 @@ import org.apache.camel.spi.UriEndpoint;
 @UriEndpoint(scheme = "sftp", consumerClass = SftpConsumer.class, label = 
"file")
 public class SftpEndpoint extends RemoteFileEndpoint<ChannelSftp.LsEntry> {
 
+    @UriParam
+    protected SftpConfiguration configuration;
+    @UriParam
     Proxy proxy;
     
     public SftpEndpoint() {
@@ -39,7 +44,15 @@ public class SftpEndpoint extends 
RemoteFileEndpoint<ChannelSftp.LsEntry> {
 
     @Override
     public SftpConfiguration getConfiguration() {
-        return (SftpConfiguration) this.configuration;
+        return this.configuration;
+    }
+
+    @Override
+    public void setConfiguration(GenericFileConfiguration configuration) {
+        if (configuration == null) {
+            throw new IllegalArgumentException("SftpConfiguration expected");
+        }
+        this.configuration = (SftpConfiguration) configuration;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/camel/blob/39010f4e/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpComponentConfigurationAndDocumentationTest.java
----------------------------------------------------------------------
diff --git 
a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpComponentConfigurationAndDocumentationTest.java
 
b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpComponentConfigurationAndDocumentationTest.java
index 60c6268..e424012 100644
--- 
a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpComponentConfigurationAndDocumentationTest.java
+++ 
b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpComponentConfigurationAndDocumentationTest.java
@@ -42,6 +42,8 @@ public class FtpComponentConfigurationAndDocumentationTest 
extends CamelTestSupp
         String json = compConf.createParameterJsonSchema();
         assertNotNull(json);
 
+        assertTrue(json.contains("\"host\": { \"kind\": \"path\", \"type\": 
\"string\""));
+        assertTrue(json.contains("\"port\": { \"kind\": \"path\", \"type\": 
\"integer\""));
         assertTrue(json.contains("\"maximumReconnectAttempts\": { \"kind\": 
\"parameter\", \"type\": \"integer\""));
         assertTrue(json.contains("\"dataTimeout\": { \"kind\": \"parameter\", 
\"type\": \"integer\""));
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/39010f4e/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpsComponentConfigurationAndDocumentationTest.java
----------------------------------------------------------------------
diff --git 
a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpsComponentConfigurationAndDocumentationTest.java
 
b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpsComponentConfigurationAndDocumentationTest.java
index 25485fd..1d79610 100644
--- 
a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpsComponentConfigurationAndDocumentationTest.java
+++ 
b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpsComponentConfigurationAndDocumentationTest.java
@@ -42,6 +42,8 @@ public class FtpsComponentConfigurationAndDocumentationTest 
extends CamelTestSup
         String json = compConf.createParameterJsonSchema();
         assertNotNull(json);
 
+        assertTrue(json.contains("\"host\": { \"kind\": \"path\", \"type\": 
\"string\""));
+        assertTrue(json.contains("\"port\": { \"kind\": \"path\", \"type\": 
\"integer\""));
         assertTrue(json.contains("\"maximumReconnectAttempts\": { \"kind\": 
\"parameter\", \"type\": \"integer\""));
         assertTrue(json.contains("\"dataTimeout\": { \"kind\": \"parameter\", 
\"type\": \"integer\""));
     }

Reply via email to