Return-Path: X-Original-To: apmail-camel-dev-archive@www.apache.org Delivered-To: apmail-camel-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 14D48524 for ; Thu, 21 Jun 2012 11:46:56 +0000 (UTC) Received: (qmail 22644 invoked by uid 500); 21 Jun 2012 11:46:55 -0000 Delivered-To: apmail-camel-dev-archive@camel.apache.org Received: (qmail 22397 invoked by uid 500); 21 Jun 2012 11:46:55 -0000 Mailing-List: contact dev-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list dev@camel.apache.org Received: (qmail 22374 invoked by uid 99); 21 Jun 2012 11:46:54 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Jun 2012 11:46:54 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of hekonsek@gmail.com designates 209.85.160.173 as permitted sender) Received: from [209.85.160.173] (HELO mail-gh0-f173.google.com) (209.85.160.173) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Jun 2012 11:46:47 +0000 Received: by ghrr14 with SMTP id r14so411815ghr.32 for ; Thu, 21 Jun 2012 04:46:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=RwoIJywP0zqX58EuXF4yFeVaqytjuRYx6xrlqqnziqQ=; b=JIjyb1NjSOuDEqZcTLmoWv+2c1Ht7ed5oBZNTphYfTnTSLpSmYNBSTFnrueNHOTEEp vFmT7aNUrlEsvOTYOEP/3fLFC/wCGS6K/gpq1+Nwzh+aJlS81FuxSASxJ1WOcSdamjEP o4V3BjqzzihAF6WCzBxaszYDm1WUzirJ+k7gBjfZm1+gcvefn1LuYr0cTH6lAlfrB0FN 6LXWE4vYy0zPGKYd8aJmP7oxkAHLyq0B5WXlM9icsXgaCY1aIv4jUqlbQGhmQg8mUWcL uYSOqoYaQ+cUgcoVfoGAMWUGQi3CUwbI7i4Qmbo4LuQHHbmmurqQbTD/ZsVXT4fbTRn9 9WQw== MIME-Version: 1.0 Received: by 10.236.73.6 with SMTP id u6mr4001697yhd.31.1340279186756; Thu, 21 Jun 2012 04:46:26 -0700 (PDT) Received: by 10.236.67.67 with HTTP; Thu, 21 Jun 2012 04:46:26 -0700 (PDT) In-Reply-To: References: <4FD60168.5090009@gmail.com> <4FE1C1A9.3030701@gmail.com> <4FE1D7FD.9000601@gmail.com> <4FE1FA60.3030603@gmail.com> Date: Thu, 21 Jun 2012 13:46:26 +0200 Message-ID: Subject: Re: [DISCUSS] Should camel enforce usage of proper URIs? From: Henryk Konsek To: dev@camel.apache.org Content-Type: text/plain; charset=ISO-8859-1 > It seems that you want to force incompatibly between Camel 2.x and 3.0 > which is a NOT "a no brainer" for me. Good point. We will end up with ugly and backward incompatible URIs. What about introducing "implicit URI encoding" term? Can't we just assume that semi-URIs strings passed to the Camel DSLs are in fact decoded URIs? In such case: import org.springframework.web.util.UriUtils; // Decoded URI passed to the component. String decodedUri = "file://inbox?expression=backup/${date:now:yyyyMMdd}/${file:name}"; // If we encode this URI we will end up with valid URI: // file://inbox?expression=backup/$%7Bdate:now:yyyyMMdd%7D/$%7Bfile:name%7D String encodedUri = UriUtils.encodeUri(decodedUri, "UTF-8"); Maybe we just could validate that URI passed to the component is valid AFTER encoding it? String decodedUriFromDsl = ... String encodedUri = UriUtils.encodeUri(decodedUriFromDsl, "UTF-8"); assertValidUri(encodedUri); This will guarantee that Camel uses valid URIs but won't break contract of many existing components. -- Henryk Konsek http://henryk-konsek.blogspot.com