You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2019/05/28 04:10:26 UTC

[camel] branch master updated (2f744d6 -> 9008caa)

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git.


    from 2f744d6  CAMEL-13483 File Component: Add option to fail startup when not having read permission on folder
     new c383b69  CAMEL-13483: Fixed CS
     new df1f34f  Fixed CS
     new dd6f67a  Move some options that was only used by file component out of general so they dont get inherited in ftp component.
     new 9008caa  Fixed CS

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../component/cxf/converter/CachedCxfPayload.java  |  2 +-
 .../apache/camel/component/file/FileEndpoint.java  | 56 +++++++++++++++++---
 .../camel/component/file/GenericFileEndpoint.java  | 44 ----------------
 .../camel-ftp/src/main/docs/ftp-component.adoc     |  4 +-
 .../camel-ftp/src/main/docs/ftps-component.adoc    |  4 +-
 .../camel-ftp/src/main/docs/sftp-component.adoc    |  4 +-
 .../camel/component/jms/JmsXMLRouteTest.java       |  2 +-
 .../camel/component/xquery/XQueryBuilder.java      |  4 +-
 .../camel/converter/saxon/SaxonConverterTest.java  |  2 +-
 .../spring/ws/ProducerLocalRouteTest.java          |  2 +-
 .../processor/XmlSignatureProcessor.java           |  3 +-
 ...onsumerStartingDirectoryMustHaveAccessTest.java | 59 +++++++++++-----------
 .../apache/camel/converter/StringSourceTest.java   |  2 +-
 .../camel/converter/jaxp/BytesSourceTest.java      |  2 +-
 .../camel/converter/jaxp/XmlConverterTest.java     |  5 +-
 .../apache/camel/impl/LogDebugBodyStreamsTest.java |  2 +-
 .../MultiCastParallelAndStreamCachingTest.java     |  3 +-
 .../StreamSourceContentBasedRouterTest.java        |  4 +-
 .../ValidatingProcessorFromSourceTest.java         |  3 +-
 .../camel/processor/ValidatingProcessorTest.java   |  3 +-
 .../apache/camel/converter/jaxp/XmlConverter.java  |  4 +-
 21 files changed, 105 insertions(+), 109 deletions(-)


[camel] 04/04: Fixed CS

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 9008caab173f51dbcfdbf3a10c1a4953d48180ef
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue May 28 06:10:15 2019 +0200

    Fixed CS
---
 .../org/apache/camel/component/cxf/converter/CachedCxfPayload.java    | 2 +-
 .../src/test/java/org/apache/camel/component/jms/JmsXMLRouteTest.java | 2 +-
 .../main/java/org/apache/camel/component/xquery/XQueryBuilder.java    | 4 ++--
 .../java/org/apache/camel/converter/saxon/SaxonConverterTest.java     | 2 +-
 .../org/apache/camel/component/spring/ws/ProducerLocalRouteTest.java  | 2 +-
 .../camel/component/xmlsecurity/processor/XmlSignatureProcessor.java  | 3 ++-
 6 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/converter/CachedCxfPayload.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/converter/CachedCxfPayload.java
index 27cec31..5335d75 100644
--- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/converter/CachedCxfPayload.java
+++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/converter/CachedCxfPayload.java
@@ -38,10 +38,10 @@ import org.apache.camel.Exchange;
 import org.apache.camel.StreamCache;
 import org.apache.camel.component.cxf.CxfPayload;
 import org.apache.camel.converter.stream.CachedOutputStream;
-import org.apache.camel.util.xml.StreamSourceCache;
 import org.apache.camel.support.builder.xml.StAX2SAXSource;
 import org.apache.camel.support.builder.xml.XMLConverterHelper;
 import org.apache.camel.util.ObjectHelper;
+import org.apache.camel.util.xml.StreamSourceCache;
 import org.apache.cxf.staxutils.StaxSource;
 import org.apache.cxf.staxutils.StaxUtils;
 import org.slf4j.Logger;
diff --git a/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsXMLRouteTest.java b/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsXMLRouteTest.java
index 71eed49..b4a91f8 100644
--- a/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsXMLRouteTest.java
+++ b/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsXMLRouteTest.java
@@ -25,10 +25,10 @@ import javax.xml.transform.stream.StreamSource;
 import org.apache.camel.CamelContext;
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
-import org.apache.camel.util.xml.StringSource;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.test.junit4.CamelTestSupport;
+import org.apache.camel.util.xml.StringSource;
 import org.junit.Test;
 
 import static org.apache.camel.component.jms.JmsComponent.jmsComponentAutoAcknowledge;
diff --git a/components/camel-saxon/src/main/java/org/apache/camel/component/xquery/XQueryBuilder.java b/components/camel-saxon/src/main/java/org/apache/camel/component/xquery/XQueryBuilder.java
index 6bbdb39..5cf7fc4 100644
--- a/components/camel-saxon/src/main/java/org/apache/camel/component/xquery/XQueryBuilder.java
+++ b/components/camel-saxon/src/main/java/org/apache/camel/component/xquery/XQueryBuilder.java
@@ -61,7 +61,6 @@ import net.sf.saxon.value.Int64Value;
 import net.sf.saxon.value.IntegerValue;
 import net.sf.saxon.value.ObjectValue;
 import net.sf.saxon.value.StringValue;
-import org.apache.camel.util.xml.BytesSource;
 import org.apache.camel.Exchange;
 import org.apache.camel.Expression;
 import org.apache.camel.Message;
@@ -69,11 +68,12 @@ import org.apache.camel.NoTypeConversionAvailableException;
 import org.apache.camel.Predicate;
 import org.apache.camel.Processor;
 import org.apache.camel.RuntimeExpressionException;
-import org.apache.camel.util.xml.StringSource;
 import org.apache.camel.spi.NamespaceAware;
 import org.apache.camel.support.MessageHelper;
 import org.apache.camel.util.IOHelper;
 import org.apache.camel.util.ObjectHelper;
+import org.apache.camel.util.xml.BytesSource;
+import org.apache.camel.util.xml.StringSource;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
diff --git a/components/camel-saxon/src/test/java/org/apache/camel/converter/saxon/SaxonConverterTest.java b/components/camel-saxon/src/test/java/org/apache/camel/converter/saxon/SaxonConverterTest.java
index d903112..4749df1 100644
--- a/components/camel-saxon/src/test/java/org/apache/camel/converter/saxon/SaxonConverterTest.java
+++ b/components/camel-saxon/src/test/java/org/apache/camel/converter/saxon/SaxonConverterTest.java
@@ -33,10 +33,10 @@ import net.sf.saxon.om.NodeInfo;
 import net.sf.saxon.trans.XPathException;
 import net.sf.saxon.xpath.XPathEvaluator;
 import org.apache.camel.Exchange;
-import org.apache.camel.util.xml.StringSource;
 import org.apache.camel.language.xpath.DefaultNamespaceContext;
 import org.apache.camel.support.DefaultExchange;
 import org.apache.camel.test.junit4.CamelTestSupport;
+import org.apache.camel.util.xml.StringSource;
 import org.junit.Before;
 import org.junit.Test;
 
diff --git a/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/ProducerLocalRouteTest.java b/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/ProducerLocalRouteTest.java
index 504eb11..b509ee3 100644
--- a/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/ProducerLocalRouteTest.java
+++ b/components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/ProducerLocalRouteTest.java
@@ -23,8 +23,8 @@ import org.apache.camel.ExchangePattern;
 import org.apache.camel.Message;
 import org.apache.camel.Produce;
 import org.apache.camel.ProducerTemplate;
-import org.apache.camel.util.xml.StringSource;
 import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.util.xml.StringSource;
 import org.junit.Test;
 import org.springframework.test.context.ContextConfiguration;
 import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
diff --git a/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/processor/XmlSignatureProcessor.java b/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/processor/XmlSignatureProcessor.java
index 1ade0e6..eddebb7 100644
--- a/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/processor/XmlSignatureProcessor.java
+++ b/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/processor/XmlSignatureProcessor.java
@@ -27,7 +27,7 @@ import javax.xml.validation.Schema;
 import javax.xml.validation.SchemaFactory;
 
 import org.xml.sax.SAXException;
-import org.apache.camel.util.xml.BytesSource;
+
 import org.apache.camel.Message;
 import org.apache.camel.Processor;
 import org.apache.camel.component.validator.DefaultLSResourceResolver;
@@ -36,6 +36,7 @@ import org.apache.camel.component.xmlsecurity.api.XmlSignatureException;
 import org.apache.camel.support.ResourceHelper;
 import org.apache.camel.util.IOHelper;
 import org.apache.camel.util.ObjectHelper;
+import org.apache.camel.util.xml.BytesSource;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 


[camel] 03/04: Move some options that was only used by file component out of general so they dont get inherited in ftp component.

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit dd6f67ae2cc44eafca1b8ab6901715114421d0f5
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue May 28 06:05:24 2019 +0200

    Move some options that was only used by file component out of general so they dont get inherited in ftp component.
---
 .../apache/camel/component/file/FileEndpoint.java  | 48 +++++++++++++++++++++-
 .../camel/component/file/GenericFileEndpoint.java  | 44 --------------------
 .../camel-ftp/src/main/docs/ftp-component.adoc     |  4 +-
 .../camel-ftp/src/main/docs/ftps-component.adoc    |  4 +-
 .../camel-ftp/src/main/docs/sftp-component.adoc    |  4 +-
 5 files changed, 49 insertions(+), 55 deletions(-)

diff --git a/components/camel-file/src/main/java/org/apache/camel/component/file/FileEndpoint.java b/components/camel-file/src/main/java/org/apache/camel/component/file/FileEndpoint.java
index 63af76d..a6100f1 100644
--- a/components/camel-file/src/main/java/org/apache/camel/component/file/FileEndpoint.java
+++ b/components/camel-file/src/main/java/org/apache/camel/component/file/FileEndpoint.java
@@ -57,12 +57,18 @@ public class FileEndpoint extends GenericFileEndpoint<File> {
     private boolean copyAndDeleteOnRenameFail = true;
     @UriParam(label = "advanced")
     private boolean renameUsingCopy;
-    @UriParam(label = "producer,advanced", defaultValue = "true")
-    private boolean forceWrites = true;
+    @UriParam(label = "consumer,advanced")
+    protected boolean startingDirectoryMustExist;
+    @UriParam(label = "consumer,advanced")
+    protected boolean startingDirectoryMustHaveAccess;
+    @UriParam(label = "consumer,advanced")
+    protected boolean directoryMustExist;
     @UriParam(label = "consumer,advanced")
     private boolean probeContentType;
     @UriParam(label = "consumer,advanced")
     private String extendedAttributes;
+    @UriParam(label = "producer,advanced", defaultValue = "true")
+    private boolean forceWrites = true;
     @UriParam(label = "producer,advanced")
     private String chmod;
     @UriParam(label = "producer,advanced")
@@ -258,6 +264,44 @@ public class FileEndpoint extends GenericFileEndpoint<File> {
         this.renameUsingCopy = renameUsingCopy;
     }
 
+    public boolean isStartingDirectoryMustExist() {
+        return startingDirectoryMustExist;
+    }
+
+    /**
+     * Whether the starting directory must exist. Mind that the autoCreate option is default enabled,
+     * which means the starting directory is normally auto created if it doesn't exist.
+     * You can disable autoCreate and enable this to ensure the starting directory must exist. Will thrown an exception if the directory doesn't exist.
+     */
+    public void setStartingDirectoryMustExist(boolean startingDirectoryMustExist) {
+        this.startingDirectoryMustExist = startingDirectoryMustExist;
+    }
+
+    public boolean isStartingDirectoryMustHaveAccess() {
+        return startingDirectoryMustHaveAccess;
+    }
+
+    /**
+     * Whether the starting directory has access permissions. Mind that the
+     * startingDirectoryMustExist parameter must be set to true in order to verify that the
+     * directory exists. Will thrown an exception if the directory doesn't have
+     * read and write permissions.
+     */
+    public void setStartingDirectoryMustHaveAccess(boolean startingDirectoryMustHaveAccess) {
+        this.startingDirectoryMustHaveAccess = startingDirectoryMustHaveAccess;
+    }
+
+    public boolean isDirectoryMustExist() {
+        return directoryMustExist;
+    }
+
+    /**
+     * Similar to the startingDirectoryMustExist option but this applies during polling (after starting the consumer).
+     */
+    public void setDirectoryMustExist(boolean directoryMustExist) {
+        this.directoryMustExist = directoryMustExist;
+    }
+
     public boolean isForceWrites() {
         return forceWrites;
     }
diff --git a/components/camel-file/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java b/components/camel-file/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java
index 62c39bd..ed2b8c9 100644
--- a/components/camel-file/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java
+++ b/components/camel-file/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java
@@ -108,12 +108,6 @@ public abstract class GenericFileEndpoint<T> extends ScheduledPollEndpoint imple
     protected IdempotentRepository inProgressRepository = MemoryIdempotentRepository.memoryIdempotentRepository(DEFAULT_IN_PROGRESS_CACHE_SIZE);
     @UriParam(label = "consumer,advanced")
     protected String localWorkDirectory;
-    @UriParam(label = "consumer,advanced")
-    protected boolean startingDirectoryMustExist;
-    @UriParam(label = "consumer,advanced")
-    protected boolean startingDirectoryMustHaveAccess;
-    @UriParam(label = "consumer,advanced")
-    protected boolean directoryMustExist;
     @UriParam(label = "consumer")
     protected boolean noop;
     @UriParam(label = "consumer")
@@ -1111,44 +1105,6 @@ public abstract class GenericFileEndpoint<T> extends ScheduledPollEndpoint imple
         this.autoCreate = autoCreate;
     }
 
-    public boolean isStartingDirectoryMustExist() {
-        return startingDirectoryMustExist;
-    }
-
-    /**
-     * Whether the starting directory must exist. Mind that the autoCreate option is default enabled,
-     * which means the starting directory is normally auto created if it doesn't exist.
-     * You can disable autoCreate and enable this to ensure the starting directory must exist. Will thrown an exception if the directory doesn't exist.
-     */
-    public void setStartingDirectoryMustExist(boolean startingDirectoryMustExist) {
-        this.startingDirectoryMustExist = startingDirectoryMustExist;
-    }
-
-    public boolean isStartingDirectoryMustHaveAccess() {
-        return startingDirectoryMustHaveAccess;
-    }
-
-    /**
-     * Whether the starting directory has access permissions. Mind that the
-     * startingDirectoryMustExist parameter must be set to true in order to verify that the
-     * directory exists. Will thrown an exception if the directory doesn't have
-     * read and write permissions.
-     */
-    public void setStartingDirectoryMustHaveAccess(boolean startingDirectoryMustHaveAccess) {
-        this.startingDirectoryMustHaveAccess = startingDirectoryMustHaveAccess;
-    }
-
-    public boolean isDirectoryMustExist() {
-        return directoryMustExist;
-    }
-
-    /**
-     * Similar to the startingDirectoryMustExist option but this applies during polling (after starting the consumer).
-     */
-    public void setDirectoryMustExist(boolean directoryMustExist) {
-        this.directoryMustExist = directoryMustExist;
-    }
-
     public GenericFileProcessStrategy<T> getProcessStrategy() {
         return processStrategy;
     }
diff --git a/components/camel-ftp/src/main/docs/ftp-component.adoc b/components/camel-ftp/src/main/docs/ftp-component.adoc
index a48b3ee..229b955 100644
--- a/components/camel-ftp/src/main/docs/ftp-component.adoc
+++ b/components/camel-ftp/src/main/docs/ftp-component.adoc
@@ -109,7 +109,7 @@ with the following path and query parameters:
 |===
 
 
-==== Query Parameters (111 parameters):
+==== Query Parameters (109 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
@@ -136,7 +136,6 @@ with the following path and query parameters:
 | *resumeDownload* (consumer) | Configures whether resume download is enabled. This must be supported by the FTP server (almost all FTP servers support it). In addition the options localWorkDirectory must be configured so downloaded files are stored in a local directory, and the option binary must be enabled, which is required to support resuming of downloads. | false | boolean
 | *sendEmptyMessageWhenIdle* (consumer) | If the polling consumer did not poll any files, you can enable this option to send an empty message (no body) instead. | false | boolean
 | *streamDownload* (consumer) | Sets the download method to use when not using a local working directory. If set to true, the remote files are streamed to the route as they are read. When set to false, the remote files are loaded into memory before being sent into the route. | false | boolean
-| *directoryMustExist* (consumer) | Similar to the startingDirectoryMustExist option but this applies during polling (after starting the consumer). | false | boolean
 | *download* (consumer) | Whether the FTP consumer should download the file. If this option is set to false, then the message body will be null, but the consumer will still trigger a Camel Exchange that has details about the file such as file name, file size, etc. It's just that the file will not be downloaded. | false | boolean
 | *exceptionHandler* (consumer) | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored. |  | ExceptionHandler
 | *exchangePattern* (consumer) | Sets the exchange pattern when the consumer creates an exchange. |  | ExchangePattern
@@ -148,7 +147,6 @@ with the following path and query parameters:
 | *pollStrategy* (consumer) | A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing you to provide your custom implementation to control error handling usually occurred during the poll operation before an Exchange have been created and being routed in Camel. |  | PollingConsumerPoll Strategy
 | *processStrategy* (consumer) | A pluggable org.apache.camel.component.file.GenericFileProcessStrategy allowing you to implement your own readLock option or similar. Can also be used when special conditions must be met before a file can be consumed, such as a special ready file exists. If this option is set then the readLock option does not apply. |  | GenericFileProcess Strategy
 | *receiveBufferSize* (consumer) | The receive (download) buffer size Used only by FTPClient | 32768 | int
-| *startingDirectoryMustExist* (consumer) | Whether the starting directory must exist. Mind that the autoCreate option is default enabled, which means the starting directory is normally auto created if it doesn't exist. You can disable autoCreate and enable this to ensure the starting directory must exist. Will thrown an exception if the directory doesn't exist. | false | boolean
 | *useList* (consumer) | Whether to allow using LIST command when downloading a file. Default is true. In some use cases you may want to download a specific file and are not allowed to use the LIST command, and therefore you can set this option to false. Notice when using this option, then the specific file to download does not include meta-data information such as file size, timestamp, permissions etc, because those information is only possible to retrieve when LIST command is in use. | [...]
 | *fileExist* (producer) | What to do if a file already exists with the same name. Override, which is the default, replaces the existing file. Append - adds content to the existing file. Fail - throws a GenericFileOperationException, indicating that there is already an existing file. Ignore - silently ignores the problem and does not override the existing file, but assumes everything is okay. Move - option requires to use the moveExisting option to be configured as well. The option eager [...]
 | *flatten* (producer) | Flatten is used to flatten the file name path to strip any leading paths, so it's just the file name. This allows you to consume recursively into sub-directories, but when you eg write the files to another directory they will be written in a single directory. Setting this to true on the producer enforces that any file name in CamelFileName header will be stripped for any leading paths. | false | boolean
diff --git a/components/camel-ftp/src/main/docs/ftps-component.adoc b/components/camel-ftp/src/main/docs/ftps-component.adoc
index 9469afb..71464fa 100644
--- a/components/camel-ftp/src/main/docs/ftps-component.adoc
+++ b/components/camel-ftp/src/main/docs/ftps-component.adoc
@@ -61,7 +61,7 @@ with the following path and query parameters:
 |===
 
 
-==== Query Parameters (123 parameters):
+==== Query Parameters (121 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
@@ -88,7 +88,6 @@ with the following path and query parameters:
 | *resumeDownload* (consumer) | Configures whether resume download is enabled. This must be supported by the FTP server (almost all FTP servers support it). In addition the options localWorkDirectory must be configured so downloaded files are stored in a local directory, and the option binary must be enabled, which is required to support resuming of downloads. | false | boolean
 | *sendEmptyMessageWhenIdle* (consumer) | If the polling consumer did not poll any files, you can enable this option to send an empty message (no body) instead. | false | boolean
 | *streamDownload* (consumer) | Sets the download method to use when not using a local working directory. If set to true, the remote files are streamed to the route as they are read. When set to false, the remote files are loaded into memory before being sent into the route. | false | boolean
-| *directoryMustExist* (consumer) | Similar to the startingDirectoryMustExist option but this applies during polling (after starting the consumer). | false | boolean
 | *download* (consumer) | Whether the FTP consumer should download the file. If this option is set to false, then the message body will be null, but the consumer will still trigger a Camel Exchange that has details about the file such as file name, file size, etc. It's just that the file will not be downloaded. | false | boolean
 | *exceptionHandler* (consumer) | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored. |  | ExceptionHandler
 | *exchangePattern* (consumer) | Sets the exchange pattern when the consumer creates an exchange. |  | ExchangePattern
@@ -100,7 +99,6 @@ with the following path and query parameters:
 | *pollStrategy* (consumer) | A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing you to provide your custom implementation to control error handling usually occurred during the poll operation before an Exchange have been created and being routed in Camel. |  | PollingConsumerPoll Strategy
 | *processStrategy* (consumer) | A pluggable org.apache.camel.component.file.GenericFileProcessStrategy allowing you to implement your own readLock option or similar. Can also be used when special conditions must be met before a file can be consumed, such as a special ready file exists. If this option is set then the readLock option does not apply. |  | GenericFileProcess Strategy
 | *receiveBufferSize* (consumer) | The receive (download) buffer size Used only by FTPClient | 32768 | int
-| *startingDirectoryMustExist* (consumer) | Whether the starting directory must exist. Mind that the autoCreate option is default enabled, which means the starting directory is normally auto created if it doesn't exist. You can disable autoCreate and enable this to ensure the starting directory must exist. Will thrown an exception if the directory doesn't exist. | false | boolean
 | *useList* (consumer) | Whether to allow using LIST command when downloading a file. Default is true. In some use cases you may want to download a specific file and are not allowed to use the LIST command, and therefore you can set this option to false. Notice when using this option, then the specific file to download does not include meta-data information such as file size, timestamp, permissions etc, because those information is only possible to retrieve when LIST command is in use. | [...]
 | *fileExist* (producer) | What to do if a file already exists with the same name. Override, which is the default, replaces the existing file. Append - adds content to the existing file. Fail - throws a GenericFileOperationException, indicating that there is already an existing file. Ignore - silently ignores the problem and does not override the existing file, but assumes everything is okay. Move - option requires to use the moveExisting option to be configured as well. The option eager [...]
 | *flatten* (producer) | Flatten is used to flatten the file name path to strip any leading paths, so it's just the file name. This allows you to consume recursively into sub-directories, but when you eg write the files to another directory they will be written in a single directory. Setting this to true on the producer enforces that any file name in CamelFileName header will be stripped for any leading paths. | false | boolean
diff --git a/components/camel-ftp/src/main/docs/sftp-component.adoc b/components/camel-ftp/src/main/docs/sftp-component.adoc
index 6739d42..52fb1b8 100644
--- a/components/camel-ftp/src/main/docs/sftp-component.adoc
+++ b/components/camel-ftp/src/main/docs/sftp-component.adoc
@@ -60,7 +60,7 @@ with the following path and query parameters:
 |===
 
 
-==== Query Parameters (119 parameters):
+==== Query Parameters (117 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
@@ -82,7 +82,6 @@ with the following path and query parameters:
 | *recursive* (consumer) | If a directory, will look for files in all the sub-directories as well. | false | boolean
 | *sendEmptyMessageWhenIdle* (consumer) | If the polling consumer did not poll any files, you can enable this option to send an empty message (no body) instead. | false | boolean
 | *streamDownload* (consumer) | Sets the download method to use when not using a local working directory. If set to true, the remote files are streamed to the route as they are read. When set to false, the remote files are loaded into memory before being sent into the route. | false | boolean
-| *directoryMustExist* (consumer) | Similar to the startingDirectoryMustExist option but this applies during polling (after starting the consumer). | false | boolean
 | *download* (consumer) | Whether the FTP consumer should download the file. If this option is set to false, then the message body will be null, but the consumer will still trigger a Camel Exchange that has details about the file such as file name, file size, etc. It's just that the file will not be downloaded. | false | boolean
 | *exceptionHandler* (consumer) | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored. |  | ExceptionHandler
 | *exchangePattern* (consumer) | Sets the exchange pattern when the consumer creates an exchange. |  | ExchangePattern
@@ -92,7 +91,6 @@ with the following path and query parameters:
 | *onCompletionException Handler* (consumer) | To use a custom org.apache.camel.spi.ExceptionHandler to handle any thrown exceptions that happens during the file on completion process where the consumer does either a commit or rollback. The default implementation will log any exception at WARN level and ignore. |  | ExceptionHandler
 | *pollStrategy* (consumer) | A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing you to provide your custom implementation to control error handling usually occurred during the poll operation before an Exchange have been created and being routed in Camel. |  | PollingConsumerPoll Strategy
 | *processStrategy* (consumer) | A pluggable org.apache.camel.component.file.GenericFileProcessStrategy allowing you to implement your own readLock option or similar. Can also be used when special conditions must be met before a file can be consumed, such as a special ready file exists. If this option is set then the readLock option does not apply. |  | GenericFileProcess Strategy
-| *startingDirectoryMustExist* (consumer) | Whether the starting directory must exist. Mind that the autoCreate option is default enabled, which means the starting directory is normally auto created if it doesn't exist. You can disable autoCreate and enable this to ensure the starting directory must exist. Will thrown an exception if the directory doesn't exist. | false | boolean
 | *useList* (consumer) | Whether to allow using LIST command when downloading a file. Default is true. In some use cases you may want to download a specific file and are not allowed to use the LIST command, and therefore you can set this option to false. Notice when using this option, then the specific file to download does not include meta-data information such as file size, timestamp, permissions etc, because those information is only possible to retrieve when LIST command is in use. | [...]
 | *fileExist* (producer) | What to do if a file already exists with the same name. Override, which is the default, replaces the existing file. Append - adds content to the existing file. Fail - throws a GenericFileOperationException, indicating that there is already an existing file. Ignore - silently ignores the problem and does not override the existing file, but assumes everything is okay. Move - option requires to use the moveExisting option to be configured as well. The option eager [...]
 | *flatten* (producer) | Flatten is used to flatten the file name path to strip any leading paths, so it's just the file name. This allows you to consume recursively into sub-directories, but when you eg write the files to another directory they will be written in a single directory. Setting this to true on the producer enforces that any file name in CamelFileName header will be stripped for any leading paths. | false | boolean


[camel] 01/04: CAMEL-13483: Fixed CS

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit c383b69b56d0f70a2a8358091cd776c20ddb2f7f
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue May 28 05:45:17 2019 +0200

    CAMEL-13483: Fixed CS
---
 .../apache/camel/component/file/FileEndpoint.java  |  8 +--
 .../camel/component/file/GenericFileEndpoint.java  | 16 +++---
 ...onsumerStartingDirectoryMustHaveAccessTest.java | 59 +++++++++++-----------
 3 files changed, 42 insertions(+), 41 deletions(-)

diff --git a/components/camel-file/src/main/java/org/apache/camel/component/file/FileEndpoint.java b/components/camel-file/src/main/java/org/apache/camel/component/file/FileEndpoint.java
index 23e5eda..63af76d 100644
--- a/components/camel-file/src/main/java/org/apache/camel/component/file/FileEndpoint.java
+++ b/components/camel-file/src/main/java/org/apache/camel/component/file/FileEndpoint.java
@@ -93,11 +93,11 @@ public class FileEndpoint extends GenericFileEndpoint<File> {
             }
         }
         if (!isStartingDirectoryMustExist() && isStartingDirectoryMustHaveAccess()) {
-          throw new IllegalArgumentException("You cannot set startingDirectoryMustHaveAccess=true without setting startingDirectoryMustExist=true");
+            throw new IllegalArgumentException("You cannot set startingDirectoryMustHaveAccess=true without setting startingDirectoryMustExist=true");
         } else if (isStartingDirectoryMustExist() && isStartingDirectoryMustHaveAccess()) {
-          if (!file.canRead() || !file.canWrite()) {
-            throw new IOException("Starting directory permission denied: " + file);
-          }
+            if (!file.canRead() || !file.canWrite()) {
+                throw new IOException("Starting directory permission denied: " + file);
+            }
         }
         FileConsumer result = newFileConsumer(processor, operations);
 
diff --git a/components/camel-file/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java b/components/camel-file/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java
index 7f19cfd..62c39bd 100644
--- a/components/camel-file/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java
+++ b/components/camel-file/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java
@@ -1125,17 +1125,17 @@ public abstract class GenericFileEndpoint<T> extends ScheduledPollEndpoint imple
     }
 
     public boolean isStartingDirectoryMustHaveAccess() {
-      return startingDirectoryMustHaveAccess;
+        return startingDirectoryMustHaveAccess;
     }
 
-  /**
-   * Whether the starting directory has access permissions. Mind that the
-   * startingDirectoryMustExist parameter must be set to true in order to verify that the
-   * directory exists. Will thrown an exception if the directory doesn't have
-   * read and write permissions.
-   */
+    /**
+     * Whether the starting directory has access permissions. Mind that the
+     * startingDirectoryMustExist parameter must be set to true in order to verify that the
+     * directory exists. Will thrown an exception if the directory doesn't have
+     * read and write permissions.
+     */
     public void setStartingDirectoryMustHaveAccess(boolean startingDirectoryMustHaveAccess) {
-      this.startingDirectoryMustHaveAccess = startingDirectoryMustHaveAccess;
+        this.startingDirectoryMustHaveAccess = startingDirectoryMustHaveAccess;
     }
 
     public boolean isDirectoryMustExist() {
diff --git a/core/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerStartingDirectoryMustHaveAccessTest.java b/core/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerStartingDirectoryMustHaveAccessTest.java
index 3e66a6f..92c04b0 100644
--- a/core/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerStartingDirectoryMustHaveAccessTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerStartingDirectoryMustHaveAccessTest.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.file;
 
 import java.io.File;
 import java.io.IOException;
+
 import org.apache.camel.ContextTestSupport;
 import org.apache.camel.Endpoint;
 import org.apache.camel.Exchange;
@@ -26,39 +27,39 @@ import org.junit.Test;
 
 public class FileConsumerStartingDirectoryMustHaveAccessTest extends ContextTestSupport {
 
-  @Override
-  public void setUp() throws Exception {
-    File file1 = new File("./target/noAccess");
-    if (file1.exists()) {
-      file1.setReadable(true);
+    @Override
+    public void setUp() throws Exception {
+        File file1 = new File("./target/noAccess");
+        if (file1.exists()) {
+            file1.setReadable(true);
+        }
+        deleteDirectory("target/noAccess");
+        file1.mkdirs();
+        file1.setReadable(false);
+        super.setUp();
     }
-    deleteDirectory("target/noAccess");
-    file1.mkdirs();
-    file1.setReadable(false);
-    super.setUp();
-  }
 
-  @Override
-  public void tearDown() throws Exception {
-    File file1 = new File("./target/noAccess");
-    if (file1.exists()) {
-      file1.setReadable(true);
+    @Override
+    public void tearDown() throws Exception {
+        File file1 = new File("./target/noAccess");
+        if (file1.exists()) {
+            file1.setReadable(true);
+        }
+        super.tearDown();
     }
-    super.tearDown();
-  }
 
-  @Test
-  public void testStartingDirectoryMustHaveAccess() throws Exception {
-    Endpoint endpoint = context.getEndpoint("file://target/noAccess?autoCreate=false&startingDirectoryMustExist=true&startingDirectoryMustHaveAccess=true");
-    try {
-      endpoint.createConsumer(new Processor() {
-        public void process(Exchange exchange) throws Exception {
-          // noop
+    @Test
+    public void testStartingDirectoryMustHaveAccess() throws Exception {
+        Endpoint endpoint = context.getEndpoint("file://target/noAccess?autoCreate=false&startingDirectoryMustExist=true&startingDirectoryMustHaveAccess=true");
+        try {
+            endpoint.createConsumer(new Processor() {
+                public void process(Exchange exchange) throws Exception {
+                    // noop
+                }
+            });
+            fail("Should have thrown an exception");
+        } catch (IOException e) {
+            assertTrue(e.getMessage().startsWith("Starting directory permission denied"));
         }
-      });
-      fail("Should have thrown an exception");
-    } catch (IOException e) {
-      assertTrue(e.getMessage().startsWith("Starting directory permission denied"));
     }
-  }
 }


[camel] 02/04: Fixed CS

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit df1f34f7f47387b73ea43a70093543d7ed29faca
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue May 28 05:48:42 2019 +0200

    Fixed CS
---
 .../src/test/java/org/apache/camel/converter/StringSourceTest.java   | 2 +-
 .../test/java/org/apache/camel/converter/jaxp/BytesSourceTest.java   | 2 +-
 .../test/java/org/apache/camel/converter/jaxp/XmlConverterTest.java  | 5 ++---
 .../src/test/java/org/apache/camel/impl/LogDebugBodyStreamsTest.java | 2 +-
 .../camel/processor/MultiCastParallelAndStreamCachingTest.java       | 3 +--
 .../apache/camel/processor/StreamSourceContentBasedRouterTest.java   | 4 ++--
 .../apache/camel/processor/ValidatingProcessorFromSourceTest.java    | 3 ++-
 .../java/org/apache/camel/processor/ValidatingProcessorTest.java     | 3 ++-
 .../src/main/java/org/apache/camel/converter/jaxp/XmlConverter.java  | 4 ++--
 9 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/core/camel-core/src/test/java/org/apache/camel/converter/StringSourceTest.java b/core/camel-core/src/test/java/org/apache/camel/converter/StringSourceTest.java
index e78c464..0d0378e 100644
--- a/core/camel-core/src/test/java/org/apache/camel/converter/StringSourceTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/converter/StringSourceTest.java
@@ -21,7 +21,6 @@ import java.io.ByteArrayOutputStream;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 
-import org.apache.camel.util.xml.StringSource;
 import org.apache.camel.TypeConverter;
 import org.apache.camel.impl.converter.DefaultTypeConverter;
 import org.apache.camel.impl.engine.DefaultClassResolver;
@@ -29,6 +28,7 @@ import org.apache.camel.impl.engine.DefaultFactoryFinderResolver;
 import org.apache.camel.impl.engine.DefaultPackageScanClassResolver;
 import org.apache.camel.support.service.ServiceHelper;
 import org.apache.camel.util.ReflectionInjector;
+import org.apache.camel.util.xml.StringSource;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
diff --git a/core/camel-core/src/test/java/org/apache/camel/converter/jaxp/BytesSourceTest.java b/core/camel-core/src/test/java/org/apache/camel/converter/jaxp/BytesSourceTest.java
index f7003e6..6990474 100644
--- a/core/camel-core/src/test/java/org/apache/camel/converter/jaxp/BytesSourceTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/converter/jaxp/BytesSourceTest.java
@@ -16,8 +16,8 @@
  */
 package org.apache.camel.converter.jaxp;
 
-import org.apache.camel.util.xml.BytesSource;
 import org.apache.camel.ContextTestSupport;
+import org.apache.camel.util.xml.BytesSource;
 import org.junit.Test;
 
 public class BytesSourceTest extends ContextTestSupport {
diff --git a/core/camel-core/src/test/java/org/apache/camel/converter/jaxp/XmlConverterTest.java b/core/camel-core/src/test/java/org/apache/camel/converter/jaxp/XmlConverterTest.java
index 2ef19c3..1f33e39 100644
--- a/core/camel-core/src/test/java/org/apache/camel/converter/jaxp/XmlConverterTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/converter/jaxp/XmlConverterTest.java
@@ -15,12 +15,12 @@
  * limitations under the License.
  */
 package org.apache.camel.converter.jaxp;
+
 import java.io.File;
 import java.io.InputStream;
 import java.io.Reader;
 import java.nio.ByteBuffer;
 import java.util.Properties;
-
 import javax.xml.transform.OutputKeys;
 import javax.xml.transform.Source;
 import javax.xml.transform.dom.DOMSource;
@@ -32,15 +32,14 @@ import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
-
 import org.xml.sax.InputSource;
 
-import org.apache.camel.util.xml.BytesSource;
 import org.apache.camel.CamelContext;
 import org.apache.camel.ContextTestSupport;
 import org.apache.camel.Exchange;
 import org.apache.camel.impl.DefaultCamelContext;
 import org.apache.camel.support.DefaultExchange;
+import org.apache.camel.util.xml.BytesSource;
 import org.junit.Before;
 import org.junit.Test;
 
diff --git a/core/camel-core/src/test/java/org/apache/camel/impl/LogDebugBodyStreamsTest.java b/core/camel-core/src/test/java/org/apache/camel/impl/LogDebugBodyStreamsTest.java
index 7c52965..39ec63b 100644
--- a/core/camel-core/src/test/java/org/apache/camel/impl/LogDebugBodyStreamsTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/impl/LogDebugBodyStreamsTest.java
@@ -21,9 +21,9 @@ import java.io.InputStream;
 
 import org.apache.camel.ContextTestSupport;
 import org.apache.camel.Exchange;
-import org.apache.camel.util.xml.StringSource;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.util.xml.StringSource;
 import org.junit.Test;
 
 public class LogDebugBodyStreamsTest extends ContextTestSupport {
diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/MultiCastParallelAndStreamCachingTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/MultiCastParallelAndStreamCachingTest.java
index 679ed26..c5788a5 100644
--- a/core/camel-core/src/test/java/org/apache/camel/processor/MultiCastParallelAndStreamCachingTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/processor/MultiCastParallelAndStreamCachingTest.java
@@ -21,17 +21,16 @@ import java.io.ByteArrayOutputStream;
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.io.Reader;
-
 import javax.xml.transform.sax.SAXSource;
 import javax.xml.transform.stream.StreamSource;
 
 import org.apache.camel.ContextTestSupport;
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
-import org.apache.camel.util.xml.StringSource;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.util.IOHelper;
+import org.apache.camel.util.xml.StringSource;
 import org.junit.Test;
 
 /**
diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/StreamSourceContentBasedRouterTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/StreamSourceContentBasedRouterTest.java
index cf969dd..c5c0950 100644
--- a/core/camel-core/src/test/java/org/apache/camel/processor/StreamSourceContentBasedRouterTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/processor/StreamSourceContentBasedRouterTest.java
@@ -15,14 +15,14 @@
  * limitations under the License.
  */
 package org.apache.camel.processor;
-import java.io.StringReader;
 
+import java.io.StringReader;
 import javax.xml.transform.stream.StreamSource;
 
 import org.apache.camel.ContextTestSupport;
-import org.apache.camel.util.xml.StringSource;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.util.xml.StringSource;
 import org.junit.Before;
 import org.junit.Test;
 
diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/ValidatingProcessorFromSourceTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/ValidatingProcessorFromSourceTest.java
index 3889613..42ce3c9 100644
--- a/core/camel-core/src/test/java/org/apache/camel/processor/ValidatingProcessorFromSourceTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/processor/ValidatingProcessorFromSourceTest.java
@@ -15,10 +15,11 @@
  * limitations under the License.
  */
 package org.apache.camel.processor;
+
 import java.io.File;
 
-import org.apache.camel.util.xml.StringSource;
 import org.apache.camel.support.processor.validation.ValidatingProcessor;
+import org.apache.camel.util.xml.StringSource;
 import org.junit.Before;
 import org.junit.Test;
 
diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/ValidatingProcessorTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/ValidatingProcessorTest.java
index cd4f26a..cb0b0fa0 100644
--- a/core/camel-core/src/test/java/org/apache/camel/processor/ValidatingProcessorTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/processor/ValidatingProcessorTest.java
@@ -15,17 +15,18 @@
  * limitations under the License.
  */
 package org.apache.camel.processor;
+
 import java.io.File;
 
 import org.apache.camel.ContextTestSupport;
 import org.apache.camel.RuntimeCamelException;
-import org.apache.camel.util.xml.StringSource;
 import org.apache.camel.ValidationException;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.support.processor.validation.NoXmlBodyValidationException;
 import org.apache.camel.support.processor.validation.SchemaValidationException;
 import org.apache.camel.support.processor.validation.ValidatingProcessor;
+import org.apache.camel.util.xml.StringSource;
 import org.junit.Before;
 import org.junit.Test;
 
diff --git a/core/camel-jaxp/src/main/java/org/apache/camel/converter/jaxp/XmlConverter.java b/core/camel-jaxp/src/main/java/org/apache/camel/converter/jaxp/XmlConverter.java
index 6d848ee..ce70472 100644
--- a/core/camel-jaxp/src/main/java/org/apache/camel/converter/jaxp/XmlConverter.java
+++ b/core/camel-jaxp/src/main/java/org/apache/camel/converter/jaxp/XmlConverter.java
@@ -66,15 +66,15 @@ import org.xml.sax.SAXException;
 import org.xml.sax.SAXParseException;
 import org.xml.sax.XMLReader;
 
-import org.apache.camel.util.xml.BytesSource;
 import org.apache.camel.Converter;
 import org.apache.camel.Exchange;
-import org.apache.camel.util.xml.StringSource;
 import org.apache.camel.support.CamelContextHelper;
 import org.apache.camel.support.builder.xml.StAX2SAXSource;
 import org.apache.camel.util.IOHelper;
 import org.apache.camel.util.ObjectHelper;
 import org.apache.camel.util.StringHelper;
+import org.apache.camel.util.xml.BytesSource;
+import org.apache.camel.util.xml.StringSource;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;