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 2016/08/03 06:36:21 UTC

camel git commit: CAMEL-10214: doneFileName is a common option

Repository: camel
Updated Branches:
  refs/heads/master ef2bd37c2 -> eaa3a9de4


CAMEL-10214: doneFileName is a common option

Explain how the doneFileName option works for consumers endpoints.


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

Branch: refs/heads/master
Commit: eaa3a9de494a87e16194daacff8479c50fcdb900
Parents: ef2bd37
Author: Pascal Schumacher <pa...@gmx.net>
Authored: Tue Aug 2 21:51:38 2016 +0200
Committer: Pascal Schumacher <pa...@gmx.net>
Committed: Tue Aug 2 21:51:38 2016 +0200

----------------------------------------------------------------------
 camel-core/src/main/docs/file.adoc                            | 2 +-
 .../org/apache/camel/component/file/GenericFileEndpoint.java  | 7 ++++++-
 2 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/eaa3a9de/camel-core/src/main/docs/file.adoc
----------------------------------------------------------------------
diff --git a/camel-core/src/main/docs/file.adoc b/camel-core/src/main/docs/file.adoc
index 8f92976..bcff0e8 100644
--- a/camel-core/src/main/docs/file.adoc
+++ b/camel-core/src/main/docs/file.adoc
@@ -74,7 +74,7 @@ The File component supports 81 endpoint options which are listed below:
 | Name | Group | Default | Java Type | Description
 | directoryName | common |  | File | *Required* The starting directory
 | charset | common |  | String | This option is used to specify the encoding of the file. You can use this on the consumer to specify the encodings of the files which allow Camel to know the charset it should load the file content in case the file content is being accessed. Likewise when writing a file you can use this option to specify which charset to write the file as well.
-| doneFileName | common |  | String | If provided then Camel will write a 2nd done file when the original file has been written. The done file will be empty. This option configures what file name to use. Either you can specify a fixed name. Or you can use dynamic placeholders. The done file will always be written in the same folder as the original file. Only $file.name and $file.name.noext is supported as dynamic placeholders.
+| doneFileName | common |  | String | Producer: If provided then Camel will write a 2nd done file when the original file has been written. The done file will be empty. This option configures what file name to use. Either you can specify a fixed name. Or you can use dynamic placeholders. The done file will always be written in the same folder as the original file. Consumer: If provided Camel will only consume files if a done file exists. This option configures what file name to use. Either you can specify a fixed name. Or you can use dynamic placeholders.The done file is always expected in the same folder as the original file. Only $file.name and $file.name.noext is supported as dynamic placeholders.
 | fileName | common |  | String | Use Expression such as File Language to dynamically set the filename. For consumers it's used as a filename filter. For producers it's used to evaluate the filename to write. If an expression is set it take precedence over the CamelFileName header. (Note: The header itself can also be an Expression). The expression options support both String and Expression types. If the expression is a String type it is always evaluated using the File Language. If the expression is an Expression type the specified Expression type is used - this allows you for instance to use OGNL expressions. For the consumer you can use it to filter filenames so you can for instance consume today's file using the File Language syntax: mydata-$date:now:yyyyMMdd.txt. The producers support the CamelOverruleFileName header which takes precedence over any existing CamelFileName header; the CamelOverruleFileName is a header that is used only once and makes it easier as this avoids to te
 mporary store CamelFileName and have to restore it afterwards.
 | bridgeErrorHandler | consumer | false | boolean | Allows for bridging the consumer to the Camel routing Error Handler which mean any exceptions occurred while the consumer is trying to pickup incoming messages or the likes will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions that will be logged at WARN/ERROR level and ignored.
 | delete | consumer | false | boolean | If true the file will be deleted after it is processed successfully.

http://git-wip-us.apache.org/repos/asf/camel/blob/eaa3a9de/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java b/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java
index 5cf2331..eaf12c8 100644
--- a/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java
+++ b/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java
@@ -570,11 +570,16 @@ public abstract class GenericFileEndpoint<T> extends ScheduledPollEndpoint imple
     }
 
     /**
-     * If provided, then Camel will write a 2nd done file when the original file has been written.
+     * Producer: If provided, then Camel will write a 2nd done file when the original file has been written.
      * The done file will be empty. This option configures what file name to use.
      * Either you can specify a fixed name. Or you can use dynamic placeholders.
      * The done file will always be written in the same folder as the original file.
      * <p/>
+     * Consumer: If provided, Camel will only consume files if a done file exists. 
+     * This option configures what file name to use. Either you can specify a fixed name.
+     * Or you can use dynamic placeholders.The done file is always expected in the same folder
+     * as the original file.
+     * <p/>
      * Only ${file.name} and ${file.name.noext} is supported as dynamic placeholders.
      */
     public void setDoneFileName(String doneFileName) {