You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by on...@apache.org on 2018/08/15 08:38:27 UTC
[camel] branch master updated: CAMEL-12723-revert changes and
disable unit test
This is an automated email from the ASF dual-hosted git repository.
onders pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push:
new 6afa11e CAMEL-12723-revert changes and disable unit test
6afa11e is described below
commit 6afa11e15f971d6d3a7cffea475d8af1789e4beb
Author: onders <on...@apache.org>
AuthorDate: Wed Aug 15 11:35:40 2018 +0300
CAMEL-12723-revert changes and disable unit test
---
.../org/apache/camel/component/file/remote/FtpComponent.java | 6 +++++-
.../apache/camel/component/file/remote/FtpsComponent.java | 6 +++++-
.../apache/camel/component/file/remote/SftpComponent.java | 12 +++++++++++-
.../file/remote/FileToFtpsWithDefaultSettingsIPV6Test.java | 2 ++
.../file/remote/FtpConsumerIPV6BodyAsStringTest.java | 2 ++
.../file/remote/sftp/SftpSimpleIPV6ConsumeTest.java | 2 ++
6 files changed, 27 insertions(+), 3 deletions(-)
diff --git a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpComponent.java b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpComponent.java
index 35d5b54..326d534 100644
--- a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpComponent.java
+++ b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpComponent.java
@@ -40,7 +40,11 @@ public class FtpComponent extends RemoteFileComponent<FTPFile> {
@Override
protected GenericFileEndpoint<FTPFile> buildFileEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
- FtpConfiguration config = new FtpConfiguration(new URI(uri.substring(0, uri.indexOf(":") + 1) + "//" + remaining));
+ String baseUri = getBaseUri(uri);
+
+ // lets make sure we create a new configuration as each endpoint can customize its own version
+ // must pass on baseUri to the configuration (see above)
+ FtpConfiguration config = new FtpConfiguration(new URI(baseUri));
FtpUtils.ensureRelativeFtpDirectory(this, config);
diff --git a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpsComponent.java b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpsComponent.java
index 70715d0..60c9125 100644
--- a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpsComponent.java
+++ b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpsComponent.java
@@ -49,7 +49,11 @@ public class FtpsComponent extends FtpComponent implements SSLContextParametersA
@Override
protected GenericFileEndpoint<FTPFile> buildFileEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
- FtpsConfiguration config = new FtpsConfiguration(new URI(uri.substring(0, uri.indexOf(":") + 1) + "//" + remaining));
+ String baseUri = getBaseUri(uri);
+
+ // lets make sure we create a new configuration as each endpoint can customize its own version
+ // must pass on baseUri to the configuration (see above)
+ FtpsConfiguration config = new FtpsConfiguration(new URI(baseUri));
FtpUtils.ensureRelativeFtpDirectory(this, config);
diff --git a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpComponent.java b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpComponent.java
index f7262c2..a018b87 100644
--- a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpComponent.java
+++ b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpComponent.java
@@ -38,7 +38,17 @@ public class SftpComponent extends RemoteFileComponent<SftpRemoteFile> {
@Override
protected GenericFileEndpoint<SftpRemoteFile> buildFileEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
- SftpConfiguration config = new SftpConfiguration(new URI(uri.substring(0, uri.indexOf(":") + 1) + "//" + remaining));
+ // get the base uri part before the options as they can be non URI valid such as the expression using $ chars
+ // and the URI constructor will regard $ as an illegal character and we dont want to enforce end users to
+ // to escape the $ for the expression (file language)
+ String baseUri = uri;
+ if (uri.contains("?")) {
+ baseUri = uri.substring(0, uri.indexOf("?"));
+ }
+
+ // lets make sure we create a new configuration as each endpoint can
+ // customize its own version
+ SftpConfiguration config = new SftpConfiguration(new URI(baseUri));
FtpUtils.ensureRelativeFtpDirectory(this, config);
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FileToFtpsWithDefaultSettingsIPV6Test.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FileToFtpsWithDefaultSettingsIPV6Test.java
index 666dbca..515b40e 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FileToFtpsWithDefaultSettingsIPV6Test.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FileToFtpsWithDefaultSettingsIPV6Test.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.file.remote;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
+import org.junit.Ignore;
import org.junit.Test;
/**
@@ -25,6 +26,7 @@ import org.junit.Test;
*
* @version
*/
+@Ignore
public class FileToFtpsWithDefaultSettingsIPV6Test extends FtpsServerExplicitTLSWithoutClientAuthTestSupport {
private String getFtpUrl() {
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerIPV6BodyAsStringTest.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerIPV6BodyAsStringTest.java
index e110cb8..b9855ae 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerIPV6BodyAsStringTest.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerIPV6BodyAsStringTest.java
@@ -23,11 +23,13 @@ import org.apache.camel.Producer;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Test;
/**
* @version
*/
+@Ignore
public class FtpConsumerIPV6BodyAsStringTest extends FtpServerTestSupport {
private String getFtpUrl() {
diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/sftp/SftpSimpleIPV6ConsumeTest.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/sftp/SftpSimpleIPV6ConsumeTest.java
index 175f3a3..142c845 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/sftp/SftpSimpleIPV6ConsumeTest.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/sftp/SftpSimpleIPV6ConsumeTest.java
@@ -19,11 +19,13 @@ package org.apache.camel.component.file.remote.sftp;
import org.apache.camel.Exchange;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
+import org.junit.Ignore;
import org.junit.Test;
/**
* @version
*/
+@Ignore
public class SftpSimpleIPV6ConsumeTest extends SftpServerTestSupport {
@Test