No way to extract a relative URI path string from a relative Path

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P4
    • None
    • Affects Version/s: None
    • Component/s: core-libs
    • generic
    • generic

      A DESCRIPTION OF THE PROBLEM :
      The `Path.toUri()` method is specified to return an absolute URI always. However, sometimes what you want is a relative URI with a relative path that corresponds to the file path, for the purpose of either extracting a path with platform-neutral separators, or for the raw path which is URI-encoded.

      There seem to be several not-so-great solutions to this problem, but ideally there would just be a way to acquire a relative URI directly from the `Path`. Either via `toRelativeUri()` default method on `URI`, or maybe a static method on `Path` or `Paths`. Note that absolute paths can yield a relative URI with an absolute path component as a relative URI is defined merely as one with no scheme component.

            Assignee:
            Unassigned
            Reporter:
            Andrew Wang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: