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 2013/03/25 17:17:16 UTC

[jira] [Resolved] (CAMEL-6204) loadResourceAsStream in ObjectHelper could not load resource with leading "/"

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

Claus Ibsen resolved CAMEL-6204.
--------------------------------

    Resolution: Fixed

Thanks for the patch.
                
> loadResourceAsStream in ObjectHelper could not load resource with leading "/"
> -----------------------------------------------------------------------------
>
>                 Key: CAMEL-6204
>                 URL: https://issues.apache.org/jira/browse/CAMEL-6204
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.10.4
>            Reporter: Piotr Klimczak
>            Assignee: Willem Jiang
>            Priority: Minor
>              Labels: ObjectHelper, camel-core,, load, resource, util
>             Fix For: 2.10.5, 2.11.0
>
>         Attachments: CAMEL6204.diff
>
>
> As i could not found any test for ObjectHelper.loadResourceAsStream and i have feced some unexpected behaviur I have created a simple unit test.
> The expected result is to get all resources loaded.
> Unfortunately ObjectHelper.loadResourceAsStream does no allow to load resource from relative path and for path with leading "/".
> I my opinion it is a bug.
> {code}
>     public void testLoadResourceAsStream() {
>         InputStream res1 = ObjectHelper.loadResourceAsStream("org/apache/camel/util/ObjectHelperResourceTestFile.properties");
>         InputStream res2 = ObjectHelper.loadResourceAsStream("/org/apache/camel/util/ObjectHelperResourceTestFile.properties");
>         assertNotNull("Cannot load resource without leading \"/\"", res1);
>         assertNotNull("Cannot load resource with leading \"/\"", res2);
>     }
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira