1616 [clojure.tools.build.util.file :as file]
1717 [clojure.tools.build.util.zip :as zip])
1818 (:import
19- [java.io File InputStream FileInputStream BufferedInputStream IOException
20- OutputStream FileOutputStream BufferedOutputStream ByteArrayOutputStream]
19+ [java.io File InputStream IOException OutputStream ByteArrayOutputStream]
2120 [java.nio.file Files]
2221 [java.nio.file.attribute FileAttribute FileTime]
2322 [java.util.jar JarEntry JarInputStream JarOutputStream Manifest]))
111110 out-file (jio/file out-dir path)]
112111 (if string
113112 (spit out-file string :append ^boolean append)
114- (copy-stream! ^InputStream stream (BufferedOutputStream. ( FileOutputStream. out-file ^boolean append) ) buffer))
113+ (copy-stream! ^InputStream stream (jio/output-stream out-file :append append) buffer))
115114 (Files/setLastModifiedTime (.toPath out-file) last-modified-time)))
116115
117116(defn- handle-conflict
158157 ; ; write new file, parent dir exists for writing
159158 (ensure-dir (.getParentFile out-file) out-file)
160159 (do
161- (copy-stream! ^InputStream is (BufferedOutputStream. ( FileOutputStream. out-file) ) buffer)
160+ (copy-stream! ^InputStream is (jio/output-stream out-file) buffer)
162161 (Files/setLastModifiedTime (.toPath out-file) last-modified-time)
163162 state)
164163
173172 state
174173
175174 (str/ends-with? (.getPath lib-file) " .jar" )
176- (with-open [jis (JarInputStream. (BufferedInputStream. ( FileInputStream. lib-file) ))]
175+ (with-open [jis (JarInputStream. (jio/input-stream lib-file))]
177176 (loop [the-state state]
178177 (if-let [entry (.getNextJarEntry jis)]
179178 (let [path (.getName entry)
297296 (.exists (jio/file working-dir " META-INF" " versions" )) (assoc " Multi-Release" " true" ))
298297 mf-attr-strs))
299298 (file/ensure-dir (.getParent uber-file))
300- (with-open [jos (JarOutputStream. (FileOutputStream. uber-file) manifest)]
299+ (with-open [jos (JarOutputStream. (jio/output-stream uber-file) manifest)]
301300 (zip/copy-to-zip jos working-dir)))
302301 (finally
303- (file/delete working-dir)))))
302+ (file/delete working-dir)))))
0 commit comments