camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Uri file endpoint question - Camel 2.x
Date Wed, 01 Jul 2009 08:52:01 GMT
On Wed, Jul 1, 2009 at 10:49 AM, Charles Moulliard<cmoulliard@gmail.com> wrote:
> Sorry for my mistake ;-)

Yeah there was a tip on the wiki page as well about this. But nice to
know its not that abvious. Maybe Camel should validate this and thrown
an exception if you have ${ in the starting path name.
I think I will add a ticket about this.


Only directories
Camel 2.0 only support endpoints configured with a starting directory.
So the directoryName must be a directory.
If you want to consume a single file only, you can use the fileName
option to only select your filename, e.g. by just setting
fileName=thefilename.

In Camel 1.x you could also configure a file and this caused more harm
than good as it could lead to confusing situations.



>
> Charles Moulliard
> Senior Enterprise Architect
> Apache Camel Committer
>
> *****************************
> blog : http://cmoulliard.blogspot.com
>
>
> On Wed, Jul 1, 2009 at 10:46 AM, Claus Ibsen <claus.ibsen@gmail.com> wrote:
>
>> On Wed, Jul 1, 2009 at 10:33 AM, Charles Moulliard<cmoulliard@gmail.com>
>> wrote:
>> > Hi,
>> >
>> > I have configured my file endpoint like this :
>> >
>> >
>> file://d:/temp/data/notification/${date:now:yyyyMMdd}/${in.header.messageType}-${date:now:hhmmss}.txt
>> >
>> > Directory = /d:/temp/data/notification/${date:now:yyyyMMdd}/
>> > FileName = ${in.header.messageType}-${date:now:hhmmss}.txt
>> >
>> > Remark : notificationType is well present in the Header of the message
>> > exchange with this endpoint
>> >
>> > but Camel generates the following error :
>> >
>> > Caused by: java.io.FileNotFoundException:
>> >
>> d:\temp\data\notification\${date:now:yyyyMMdd}\${in.header.messageType}-${date:now:hhmmss}.txt\ID-dell-charles-1778-1246434755850-1-17
>> > (The filename, directory name, or volume label syntax is incorrect)
>> >
>> > Where is the issue ?
>>
>> The uri should contain the basepath in regular plain string text (its
>> NOT dynamic).
>> So it should be: file://d:/temp/data/notification
>>
>> Then the dynamic part should be in the fileName option, as we want to
>> only poll this file.
>> So it should be:
>> ${date:now:yyyyMMdd}/${in.header.messageType}-${date:now:hhmmss}.txt
>>
>> And the total uri is then:
>>
>> file://d:/temp/data/notification?fileName=${date:now:yyyyMMdd}/${in.header.messageType}-${date:now:hhmmss}.txt
>>
>>
>>
>> >
>> > Regards
>> >
>> > Charles Moulliard
>> > Senior Enterprise Architect
>> > Apache Camel Committer
>> >
>> > *****************************
>> > blog : http://cmoulliard.blogspot.com
>> >
>>
>>
>>
>> --
>> Claus Ibsen
>> Apache Camel Committer
>>
>> Open Source Integration: http://fusesource.com
>> Blog: http://davsclaus.blogspot.com/
>> Twitter: http://twitter.com/davsclaus
>>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Mime
View raw message