You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Rastislav Papp (Jira)" <ji...@apache.org> on 2021/06/11 14:41:00 UTC
[jira] [Commented] (CAMEL-16709) camel resource handling of windows
file uri
[ https://issues.apache.org/jira/browse/CAMEL-16709?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17361824#comment-17361824 ]
Rastislav Papp commented on CAMEL-16709:
----------------------------------------
Sorry, I thought I've created the ticket with the wrong issue type (Improvement), I see now that you've changed it. My bad :)
> camel resource handling of windows file uri
> -------------------------------------------
>
> 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
> Priority: Minor
>
> 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)