You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2021/06/12 08:01:00 UTC

[jira] [Updated] (CAMEL-16709) camel-core - camel resource handling of windows file uri problem

     [ https://issues.apache.org/jira/browse/CAMEL-16709?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen updated CAMEL-16709:
--------------------------------
    Summary: camel-core - camel resource handling of windows file uri problem  (was: camel resource handling of windows file uri)

> camel-core - camel resource handling of windows file uri problem
> ----------------------------------------------------------------
>
>                 Key: CAMEL-16709
>                 URL: https://issues.apache.org/jira/browse/CAMEL-16709
>             Project: Camel
>          Issue Type: Improvement
>          Components: came-core
>    Affects Versions: 3.10.0
>            Reporter: Rastislav Papp
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 3.11.0
>
>
> In 3.10.0 (maybe sooner, we're trying to switch from 3.6.0) handling of URIs has changed, and this code no longer works:
> {code:java}
> org.apache.camel.support.ResourceHelper.resolveMandatoryResourceAsInputStream(context, "file:/C:/test.txt");
> {code}
> because Camel will try to send {{"/C:/xxx.txt"}} into {{Paths.get(...)}}, instead of {{new FileInputStream(...)}} as before. {{Paths.get}} cannot handle the initial slash. 
> Switching to the format without the slash - {{"file:C:/..."}} would work, but then following code does not:
> {code:java}
> Path path = Paths.get(URI.create("file:C:/test.txt"));
> {code}
> It fails with {{URI is not hierarchical}} message (and we use something like this in multiple places, so this stops us from upgrading to newer versions of camel)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)