[ 
https://issues.apache.org/jira/browse/CAMEL-16221?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17634871#comment-17634871
 ] 

Grzegorz Grzybek edited comment on CAMEL-16221 at 11/16/22 2:47 PM:
--------------------------------------------------------------------

Just to provide some summary:
* if there are two slashes ({{//}}) after first colon, what follows is _always_ 
the _authority_ ({{java.net.URI#getAuthority()}}), so:
** {{file:/path/to/file.txt}} - authority is null and {{/path/to/file.txt}} is 
the path
** {{file://path/to/file.txt}} - {{path}} is the authority, {{/to/file.txt}} is 
the path
** {{file:///path/to/file.txt}} - authority is null and the path is 
{{/path/to/file.txt}}
* if there's no slash after first colon, the URI is always _opaque_ - it never 
has any path ({{java.net.URI#getPath()}}), it has only three components:
** scheme
** scheme-specific part
** fragment
* if there's a scheme, the URI is always absolute (whether or not there's a 
slash after scheme)
* if there's no scheme, the URI is never absolute (even in 
{{java.net.URI.create("/hello")}}).


was (Author: gzres):
Just to provide some summary:
* if there are two slashes ({{//}}) after first colon, what follows is _always_ 
the _authority_ ({{java.net.URI#getAuthority()}}), so:
** {{file:/path/to/file.txt}} - authority is null and {{/path/to/file.txt}} is 
the path
** {{file://path/to/file.txt}} - {{path}} is the authority, {{/to/file.txt}} is 
the path
** {{file:///path/to/file.txt}} - authority is null and the path is 
{{/path/to/file.txt}}
* if there's no slash after first colon, the URI is always _opaque_ - it never 
has any path ({{java.net.URI#getPath()}}), it has only three components:
** scheme
** scheme-specific part
** fragment
* if there's a scheme, the URI is always absolute (whether or not there's a 
slash after scheme)
* if there's no scheme, the URI is never absolute (even in 
{{java.net.URI.create("/hello")}}.

> Rethink endpoints URI usage for camel internals
> -----------------------------------------------
>
>                 Key: CAMEL-16221
>                 URL: https://issues.apache.org/jira/browse/CAMEL-16221
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>            Reporter: Luca Burgazzoli
>            Priority: Major
>             Fix For: 4.0
>
>
> As today URIs are the primary mechanism Camel uses internally to describe 
> endpoints but I think it is time to re-consider the dependency on URIs for 
> camel internals and leave the URIs as an external representation of endpoints
> As example:
> - the Endpoint DSL is required to generate the related endpoint URI to 
> leverage Camel's APIs but to create an endpoint, the schema and a map of 
> options, would be more than enough. 
> - components that wrap other components, such as kamelets, master & co may 
> need to re-create URIs to create instances of the delegated endpoints which 
> is cumbersome as there's lot of options to take into account (RAW, 
> url-encoding, placeholders)
> - the YAML DSL and camel-kafka-connectors are using and Endpoint DSL alike 
> syntax where a user can define endpoints by scheme + option pairs without the 
> need of writing URIs.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to