Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-5632

ObjectHelper.resolveUriPath is broken, can not handle: '../../' correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.10.1
    • 2.9.4, 2.10.2, 2.11.0
    • camel-core
    • None
    • Mac os x 10.8.1
      Java 1.7.0_07

    • Unknown

    Description

      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/.'
          }
      

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            poker_jocke Joakim Sundqvist
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: