Return-Path: Delivered-To: apmail-felix-dev-archive@www.apache.org Received: (qmail 26368 invoked from network); 28 May 2010 08:34:50 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 28 May 2010 08:34:50 -0000 Received: (qmail 2443 invoked by uid 500); 28 May 2010 08:34:50 -0000 Delivered-To: apmail-felix-dev-archive@felix.apache.org Received: (qmail 2156 invoked by uid 500); 28 May 2010 08:34:48 -0000 Mailing-List: contact dev-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list dev@felix.apache.org Received: (qmail 2148 invoked by uid 99); 28 May 2010 08:34:47 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 May 2010 08:34:47 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of gnodet@gmail.com designates 74.125.82.177 as permitted sender) Received: from [74.125.82.177] (HELO mail-wy0-f177.google.com) (74.125.82.177) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 May 2010 08:34:40 +0000 Received: by wyb33 with SMTP id 33so699591wyb.22 for ; Fri, 28 May 2010 01:34:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=OagxQOCmC2a/zPhQHvvYGwjHbkI9poWASxKUIKSBJSc=; b=rF6VRYa3/uyRHtaZb5TXHUfGZaOKt84oiS9+dMKqk5cQE81XONsUr8vxzMPnaFDQWY n01qqAGhowrFMOJIcRrxq6ehQe2hGax6GID85vo3X0GgXQr0B/2BI3QxOXILQ5C/0HH7 oBwuIGFnA4oKIUqPouh8l8lD0wFmh36nSaWxE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Z8RYaLdGzRxrhQjWNUQWP3h/ONz/eDmBhf5ue7bdOtO3uI0c1VnCHoLPVVFNdDaexx bSI8zKwc+xXmV3axJ1wHmctpYcAJeWB0KYK9L2aHH2LhzuLDTJSW4GQUyp0hu6G37qk+ yrLhfqgO2mjslVp6kjOrmCUd5Q+kEHNEsEfqU= MIME-Version: 1.0 Received: by 10.216.160.80 with SMTP id t58mr15395wek.70.1275035660338; Fri, 28 May 2010 01:34:20 -0700 (PDT) Received: by 10.216.73.73 with HTTP; Fri, 28 May 2010 01:34:20 -0700 (PDT) In-Reply-To: References: Date: Fri, 28 May 2010 10:34:20 +0200 Message-ID: Subject: Re: File install 3.0.0 - avoiding property substitution From: Guillaume Nodet To: dev Content-Type: multipart/alternative; boundary=0016e64c1d169c4a7c0487a35fc9 X-Virus-Checked: Checked by ClamAV on apache.org --0016e64c1d169c4a7c0487a35fc9 Content-Type: text/plain; charset=ISO-8859-1 This looks like a bug. Could you please raise a JIRA for that ? As a workaround, you can try: file://inbox?move=backup/$\{date:now:yyyMMdd\}/$\{file:name\}${#} It will force a substitution, and thus will remove the escape chars. On Fri, May 28, 2010 at 10:11, Bengt Rodehav wrote: > Hello Guillaume, > > Thanks for your reply. However, if I escape the string the way you > describe, > then the backslash will remain in the string. The result will be: > > file://inbox?move=backup/$\{date:now:yyyMMdd\}/$\{file:name\} > > What I want is: > > file://inbox?move=backup/${date:now:yyyMMdd}/${file:name} > > Otherwise the string will not be usable for Camel. Is there a way to > accomplish this? In general terms one usually has a way to "quote" > substrings in order to avoid substitution but the quotes themselves should > be removed from the string. In this case backslash is the quoting character > but it's not removed from the end result. > > I think also that it would be good if one could escape substrings and not > only indiviudal characters (by enclosing substrings with quotes) but that > has lower priority for me if I can get the above to work. > > I've been looking at the source code in file install (3.0) and understand > why this is happening. The method of interest is substVars in class > org.apache.felix.fileinstall.internal.Util. The logic tries to find > matching DELIM_START (${) and DELIM_STOP (}). When I escape either of these > (by specifying a backslash before "${" and/or "}"), the logic will never > find matching DELIM_START and DELIM_STOP which causes the method to > immediately return without performing property substitution. The logic at > the end of the method (that removes the backslashes) is never reached. > > /Bengt > > 2010/5/27 Guillaume Nodet > > > Sure, we had the same problem in Karaf and i've fixed that as part of > > https://issues.apache.org/jira/browse/FELIX-2307 > > Basically, just add '\' before the '{' and '}' and it should work: > > > > file://inbox?move=backup/$\{date:now:yyyMMdd\}/$\{file:name\} > > > > > > On Thu, May 27, 2010 at 23:22, Bengt Rodehav wrote: > > > > > Hello everyone, > > > > > > My question didn't get much attention on my first attempt so I'll make > > > another one... > > > > > > Maybe a clarifaction of what I'm trying to do helps. I'm using Karaf as > a > > > deployment container for Camel routes. I start services, using file > > > install, > > > that house camel routes. The routes are configurable using the > > > configuration > > > admin via file install. E g I have a general file transfer route in > Camel > > > that looks like this: > > > > > > from(mFromUri).to(mToUri); > > > > > > ...where "mFromUri" and "mToUri" are properties configured via > > > configuration > > > admin. Camel itself supports a "property concept" and an example of a > > > "mFromUri" I might want to use is: > > > > > > file://inbox?move=backup/${date:now:yyyMMdd}/${file:name} > > > > > > This will cause Camel to poll the inbox folder and archive completed > > files > > > in a backup folder that is named with todays date. > > > > > > However, since file install always does property substitution itself > (in > > > this case I want Camel to do it - not file install), the URI sent to > > Camel > > > will be: > > > > > > file://inbox?move=backup// > > > > > > This is because the strings ${date:now:yyyMMdd} and ${file:name} will > be > > > transformed to empty strings since file install will regard them as > > > properties that are not defined. > > > > > > How can I work around this? Any clues? > > > > > > /Bengt > > > > > > > > > 2010/5/26 Bengt Rodehav > > > > > > > I'm using the File Install component and cannot find a way to set > > values > > > > like "${abc}" (without the quotes). File install insists on > performing > > > > property substitution which I do not want in this case. I noticed > that > > > this > > > > seems to have been addressed in version 3.0.0 but I cannot get it to > > > work. > > > > My question is: How can I set a value to "${abc}" (without the > quotes) > > > > without File install trying to perform property substitution? > > > > > > > > /Bengt > > > > > > > > > > > > > > > -- > > Cheers, > > Guillaume Nodet > > ------------------------ > > Blog: http://gnodet.blogspot.com/ > > ------------------------ > > Open Source SOA > > http://fusesource.com > > > -- Cheers, Guillaume Nodet ------------------------ Blog: http://gnodet.blogspot.com/ ------------------------ Open Source SOA http://fusesource.com --0016e64c1d169c4a7c0487a35fc9--