Joakim Sundqvist created CAMEL-5632:
---------------------------------------

             Summary: ObjectHelper.resolveUriPath is broken, can not handle:  
'../../' correctly
                 Key: CAMEL-5632
                 URL: https://issues.apache.org/jira/browse/CAMEL-5632
             Project: Camel
          Issue Type: Bug
          Components: camel-core
    Affects Versions: 2.10.1
         Environment: Mac os x 10.8.1
Java 1.7_07
            Reporter: Joakim Sundqvist


In my xsl-files I have imports and includes that resides in folders a few 
levels up.

Ex:  

<xsl:include href="../../common/myfunctions.xsl"/>

When camel starts up and tries to resolve the paths it crashes because of the 
current implementation in ObjectHelper.resolveUriPath(..)


Made a simple testcase that demonstrates my problem.





public void testResolveUriPath() throws Exception {
        assertEquals("xslt/", ObjectHelper.resolveUriPath("xslt/one/../"));     
    //  OK
        assertEquals("xslt/", 
ObjectHelper.resolveUriPath("xslt/one/../two/../"));  // OK
        assertEquals("xslt/", ObjectHelper.resolveUriPath("xslt/"));            
    // OK
        assertEquals("", ObjectHelper.resolveUriPath("./"));                    
    // OK
        assertEquals("xslt/", 
ObjectHelper.resolveUriPath("xslt/one/two/../../"));  // Fails, gives 
'xslt/one/.'
        assertEquals("xslt/", 
ObjectHelper.resolveUriPath("xslt/one/two/../.././"));// Fails, gives 
'xslt/one/.'
    }

--
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

Reply via email to