Wicket
  1. Wicket
  2. WICKET-4509

Spaces in path cause ModifcationWatcher to fail

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.5
    • Fix Version/s: 1.5.6, 6.0.0-beta2
    • Component/s: wicket
    • Labels:
      None
    • Environment:
      Windows 7

      Description

      The ModificationWatcher isn't able to reload resource files if there's a space in the path.

      The problem is that Files#getLocalFileFromUrl(String) receives an URL encoded String in which spaces are encoded to %20. They are never decoded and passed to File(). The fix is not to use the external representation of an URL but the file representation.

      1. WICKET-4509.patch
        0.6 kB
        Christoph Leiter

        Activity

        Hide
        Christoph Leiter added a comment -

        Attaching patch. All current test cases pass.

        Show
        Christoph Leiter added a comment - Attaching patch. All current test cases pass.
        Hide
        Sven Meier added a comment -

        In your patch url.getFile() misses any protocol information, thus the following invocation of Files#getLocalFileFromUrl(String) always returns null.

        Show
        Sven Meier added a comment - In your patch url.getFile() misses any protocol information, thus the following invocation of Files#getLocalFileFromUrl(String) always returns null.
        Hide
        Sven Meier added a comment -

        I've changed #getLocalFileFromUrl(URL) to decode the url before passing it on to the other method.

        Regretfully Wicket's UrlDecoder is not accessible from wicket-util, so I've just used Java's default URLDecoder.

        Show
        Sven Meier added a comment - I've changed #getLocalFileFromUrl(URL) to decode the url before passing it on to the other method. Regretfully Wicket's UrlDecoder is not accessible from wicket-util, so I've just used Java's default URLDecoder.
        Hide
        Peter Ertl added a comment -

        @Sven: In 6.x, can we move UrlDecoder into wicket-util?

        Show
        Peter Ertl added a comment - @Sven: In 6.x, can we move UrlDecoder into wicket-util?
        Hide
        Peter Ertl added a comment -

        ^ and add some comment in the migration-wiki?

        Show
        Peter Ertl added a comment - ^ and add some comment in the migration-wiki?
        Hide
        Sven Meier added a comment -

        Yes, UrlDecoder could be moved. This would definitely warrant a comment in the migration-wiki .

        Show
        Sven Meier added a comment - Yes, UrlDecoder could be moved. This would definitely warrant a comment in the migration-wiki .

          People

          • Assignee:
            Sven Meier
            Reporter:
            Christoph Leiter
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development