File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed
Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -29,16 +29,17 @@ If no ClassLoader is provided, RT/baseLoader is assumed."
2929 distinct)))
3030
3131(defn ^ZipFile zip-file [jar-path]
32- (cond
33- (instance? File jar-path) ( ZipFile. ^File jar-path)
34- ( string? jar-path) (ZipFile. ^String jar-path)
35- :else
36- (throw
37- ( IllegalArgumentException. ( str " Cannot construct zipfile from " jar-path)) )))
32+ (try
33+ (cond
34+ ( instance? File jar-path) (ZipFile. ^File jar-path)
35+ ( string? jar-path) ( ZipFile. ^String jar-path))
36+ (catch Exception _
37+ nil )))
3838
3939(defn jar-entry-names* [jar-path]
40- (with-open [z (zip-file jar-path)]
41- (doall (map #(.getName ^ZipEntry %) (enumeration-seq (.entries ^ZipFile z))))))
40+ (when-let [zf (zip-file jar-path)]
41+ (with-open [z zf]
42+ (doall (map #(.getName ^ZipEntry %) (enumeration-seq (.entries ^ZipFile z)))))))
4243
4344(def jar-entry-names (memoize jar-entry-names*))
4445
You can’t perform that action at this time.
0 commit comments