.setHeader("foo", header(Exchange.FILE_NAME_ONLY)) gives me a header
with  value
of ${file:onlyname} ... arg ... I am wondering if this is groovy not
playing nice.  I kinda doubt it, but next step is to write a java unit test
and recreate.

Here is the logs

 2012-03-14 11:08:15,707 INFO Camel (camelContext) thread #25 -
file:///u01/www/images/nonprofits-test [com.igive.headers] - <Exchange[
, Id:ID-goldgriff-19635-1331742082363-2-1
, ExchangePattern:InOnly
,
Properties:{CamelToEndpoint=log://com.igive.headers?multiline=true&showAll=true,
CamelBatchComplete=true, CamelBatchSize=1, CamelCreatedTimestamp=Wed Mar 14
11:08:15 MDT 2012,
CamelFileExchangeFile=GenericFile[${file:parent}/.processing/${file:onlyname}],
CamelBatchIndex=0}
, Headers:{CamelFileLastModified=Wed Mar 14 11:08:15 MDT 2012,
CamelFileLength=48215, foo=${file:onlyname},
CamelFileParent=/u01/www/images/nonprofits-test/${file:parent}/.processing,
breadcrumbId=ID-goldgriff-19635-1331742082363-2-2,
CamelFileName=${file:onlyname},
CamelFilePath=/u01/www/images/nonprofits-test/${file:parent}/.processing/${file:onlyname},
CamelFileAbsolute=false,
CamelFileRelativePath=${file:parent}/.processing/${file:onlyname},
CamelFileNameOnly=${file:onlyname},
CamelFileAbsolutePath=/u01/www/images/nonprofits-test/${file:parent}/.processing/${file:onlyname}}
, BodyType:java.io.File
, Body:[Body is file based:
/u01/www/images/nonprofits-test/${file:parent}/.processing/${file:onlyname}]
, Out: null
]>

On Wed, Mar 14, 2012 at 11:01 AM, Claus Ibsen <[email protected]> wrote:

> Hi
>
> All the file name from the simple language is headers on the message.
> So they are already there.
>
> The only name is the header with this key: Exchange.FILE_NAME_ONLY
>
> So you can copy it to a foo header as follows:
> .setHeader("foo", header(Exchange.FILE_NAME_ONLY))
>
>
>
> On Wed, Mar 14, 2012 at 5:24 PM, chrislovecnm <[email protected]>
> wrote:
> > How do I access the file name?  I have tried accessing the headers which
> gets
> > me ${file:nameonly} but not the file name itself.  How do I evaluate
> this?
> >
> > Here is my route:
> >
> >
> >
> from("file:///u01/www/images/nonprofits-test?move=.done&preMove=.processing&filter=#nonpFileFilter&minDepth=2&recursive=true")
> >
> >
> from("file:///u01/www/images/nonprofits-test?move=.done&preMove=.processing&filter=#nonpFileFilter&minDepth=2&recursive=true")
> >                                .setHeader("test-this",
> simple("\${file:onlyname}"))
> >                                .setHeader("test-this-again",
> constant("\${file:onlyname}"))
> >                                .setHeader("test-this-again2",
> simple(CamelConstants.CAMEL_FILE_NAME))
> >                                .setHeader("test-this-again3",
> > simple(CamelConstants.CAMEL_FILE_NAME_ONLY))
> >
> >
> > This is coded in grails / groovy so the \${file:name} should be
> evaluated to
> > ${file:name}, but all I get is ${file:nameonly}. I also have the string
> in
> > java code, just in-case running it in groovy is playing havoc.
> >
> > Thanks in advance
> >
> > Chris
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/File-endpoint-getting-actual-filename-file-nameonly-tp5565342p5565342.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -----------------
> FuseSource
> Email: [email protected]
> Web: http://fusesource.com
> Twitter: davsclaus, fusenews
> Blog: http://davsclaus.blogspot.com/
> Author of Camel in Action: http://www.manning.com/ibsen/
>



-- 
Chris Love
[email protected]
(303) 929-8509
http://www.cnmconsulting.net
Calendar: http://j.mp/cnmCalendar
Follow me on twitter: @chrislovecnm

Reply via email to