MyFaces Tomahawk
  1. MyFaces Tomahawk
  2. TOMAHAWK-1176

XmlTemplate fails when filename contains spaces on WindowsXP

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.1.7-SNAPSHOT
    • Fix Version/s: 1.1.7
    • Component/s: XmlTemplate
    • Labels:
      None
    • Environment:
      Windows XP SP2

      Description

      XmlTemplate uses URLs. From this it extracts the filename and uses this to load a file. WindowsXP at least doesn't understand the %20 encoding for spaces in a filename. Attached patch replaces instances of %20 in URL filepath with " " in filepath use to open file.

      1. XmlTemplate-472727-patch.txt
        1 kB
        Jayson Raymond
      2. XmlTemplateTest-508758-patch.txt
        2 kB
        Jayson Raymond

        Activity

        Hide
        Leonardo Uribe added a comment -

        fixed at revision 631391

        Show
        Leonardo Uribe added a comment - fixed at revision 631391
        Hide
        Leonardo Uribe added a comment -

        The patch works but it has several drawbacks

        Better is use

        new FileInputStream(new File(URI.create(url.toString())))

        on every call to a file instead. This solution was tested on windows and works well.

        Show
        Leonardo Uribe added a comment - The patch works but it has several drawbacks Better is use new FileInputStream(new File(URI.create(url.toString()))) on every call to a file instead. This solution was tested on windows and works well.
        Hide
        Jayson Raymond added a comment -

        Patches so XmlTemplateTest can use pathnames with spaces.

        Show
        Jayson Raymond added a comment - Patches so XmlTemplateTest can use pathnames with spaces.
        Hide
        Jayson Raymond added a comment -

        Patch for XmlTemplate to handle filenames with spaces.

        Show
        Jayson Raymond added a comment - Patch for XmlTemplate to handle filenames with spaces.

          People

          • Assignee:
            Leonardo Uribe
            Reporter:
            Jayson Raymond
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development