File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 2
2
3
3
## master (unreleased)
4
4
5
+ * [ #316 ] ( https://github.com/clojure-emacs/orchard/pull/316 ) : Java: properly convert file path that contains spaces or backslashes to URI.
6
+
5
7
## 0.30.0 (2025-01-10)
6
8
7
9
* [ #310 ] ( https://github.com/clojure-emacs/orchard/pull/310 ) : Java: add functions for downloading 3rd-party Java sources from Maven.
Original file line number Diff line number Diff line change 80
80
(defn- combine-archive-url ^URL [^File archive, relative-filename]
81
81
; ; Even though the JDK stores sources in a zip archive, we still use this
82
82
; ; function that prefixes the URL with jar:. This is fine.
83
- (io/as-url ( format " jar:file:%s!/%s "
84
- ; ; Replace backslashes with forward slashes. Needed on
85
- ; ; Windows. Forward slashes would still work there, while
86
- ; ; backslashes are forbidden in URLs.
87
- ( string/replace archive " \\ " " / " )
88
- relative-filename )))
83
+ (try
84
+ ( let [uri-str ( str ( .toURI archive))]
85
+ ( when ( string/starts-with? uri-str " file: " )
86
+ ( io/as-url ( format " jar:%s!/%s " uri-str relative-filename))))
87
+ ; ; Exceptions might happen when creating an URL, protect users from them.
88
+ ( catch java.net.MalformedURLException _ )))
89
89
90
90
(defn- locate-source-url-in-jdk-sources
91
91
" Try to find the source file for `klass` in sources included with JDK."
You can’t perform that action at this time.
0 commit comments