File component: autoCreate

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

File component: autoCreate

Nils Breunese-2
Hello,

I'm using Camel 2.0-SNAPSHOT. On http://camel.apache.org/file2.html I
read that autoCreate has a default value set to true. However, even when
I explicitly set autoCreate=true in the URI
(file:directoryName?autoCreate=true) I get an endless stream of this
repeating message:

----
6-mei-2009 13:26:09 org.apache.camel.component.file.FileConsumer
pollDirectory
WARNING: Cannot poll as directory does not exists or its not a
directory: directoryName
----

When I manually create the directory everything is fine, but then of
course autoCreate is no longer of any use.

Are others seeing this and is this a bug or is there something I'm missing?

Nils Breunese.

Reply | Threaded
Open this post in threaded view
|

Re: File component: autoCreate

Nils Breunese-2
Nils Breunese wrote:

> I'm using Camel 2.0-SNAPSHOT. On http://camel.apache.org/file2.html I
> read that autoCreate has a default value set to true. However, even when
> I explicitly set autoCreate=true in the URI
> (file:directoryName?autoCreate=true) I get an endless stream of this
> repeating message:
>
> ----
> 6-mei-2009 13:26:09 org.apache.camel.component.file.FileConsumer
> pollDirectory
> WARNING: Cannot poll as directory does not exists or its not a
> directory: directoryName
> ----
>
> When I manually create the directory everything is fine, but then of
> course autoCreate is no longer of any use.
>
> Are others seeing this and is this a bug or is there something I'm missing?

I just found out that autoCreate doesn't work when used like this:

----
from("file:directoryName").to(...);
----

But it does work when used in the to-part like this:

----
from(...).to("file:directoryName");
----

Guess I need something else to make sure the directory exists when
creating a new route starting with a file endpoint.

Nils Breunese.
Reply | Threaded
Open this post in threaded view
|

Re: File component: autoCreate

Claus Ibsen-2
Hi

Ah that was an oversigt in the wiki documentation.
autoCreate only applies for the file producer.

So when you consume with file it expects the starting directory to exists.


On Wed, May 6, 2009 at 1:51 PM, Nils Breunese <[hidden email]> wrote:

> Nils Breunese wrote:
>
>> I'm using Camel 2.0-SNAPSHOT. On http://camel.apache.org/file2.html I read
>> that autoCreate has a default value set to true. However, even when I
>> explicitly set autoCreate=true in the URI
>> (file:directoryName?autoCreate=true) I get an endless stream of this
>> repeating message:
>>
>> ----
>> 6-mei-2009 13:26:09 org.apache.camel.component.file.FileConsumer
>> pollDirectory
>> WARNING: Cannot poll as directory does not exists or its not a directory:
>> directoryName
>> ----
>>
>> When I manually create the directory everything is fine, but then of
>> course autoCreate is no longer of any use.
>>
>> Are others seeing this and is this a bug or is there something I'm
>> missing?
>
> I just found out that autoCreate doesn't work when used like this:
>
> ----
> from("file:directoryName").to(...);
> ----
>
> But it does work when used in the to-part like this:
>
> ----
> from(...).to("file:directoryName");
> ----
>
> Guess I need something else to make sure the directory exists when creating
> a new route starting with a file endpoint.
>
> Nils Breunese.
>



--
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus
Apache Camel Reference Card:
http://refcardz.dzone.com/refcardz/enterprise-integration
Interview with me:
http://architects.dzone.com/articles/interview-claus-ibsen-about?mz=7893-progress