`clojure.java.io/Coercions` currently uses URL as an intermediate representation when coercing a URI to a File. This causes an `IllegalArgumentException` when calling `as-file` on a relative URI. Java URIs and Files may be relative, but URLs are always absolute.
If a patch for this would be accepted, I'll submit one. Let me know.
Could you give an example?
Upon further review, clojure.java.io's behvior seems to be correct. java.io.URL's error messages/terminology are the culprit. Please excuse the noise.
In case the details are of use to anyone:
The Java documentation says that URLs must be absolute. What it means by this, though, is that they must specify a scheme. The path component may be relative.
Hence, these both work as expected:
But because `as-file` coerces URI to File by first converting to URL, this does not:
Contrary to the wording, the exception isn't complaining about a relative path. It means that while URIs don't always have schemes, URLs must. If you give the URI a scheme, the function succeeds:
No fix needed. Behavior is correct.
So, ok to close?
Yep, closed. Thanks, Alex.