Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-2495

Support encoded URLs in calcite.util.Source, and use it for URL->File conversion in tests

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.18.0
    • None
    • None

    Description

      URL.getPath() produces %20 when path contains spaces.
      I suggest to rework all the uses of getResource()... to use Sources.of(URL) so there's single point of failure way to convert URL to File.

      This resolves Apache CI which happens to have a space in folder name.

      For the record:
      1) URL.getPath() produces %20, so it is added to forbidden signatures
      2) Paths.get(url.toURI()).toFile() almost works, however it fails with URL is not hierarchical for new URL("file:test.java")
      3) new File(URL.toURI() is worse than #2
      4) URLDecoder must not be used to decode %20, since it will convert + to spaces as well, thus it will corrupt test.c++
      5) It looks like url.toURI().getSchemeSpecificPart()) properly handles "opaque" URIs (which are relative file:test.java kind of URLs)

      Attachments

        Issue Links

          Activity

            People

              julianhyde Julian Hyde
              vladimirsitnikov Vladimir Sitnikov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: