From debef76c0d64bc8e69a1837cbbf9f1bb58a0febd Mon Sep 17 00:00:00 2001 From: mjkhan21 Date: Fri, 18 Oct 2024 15:29:18 +0900 Subject: [PATCH] =?UTF-8?q?write(OutputStream)=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/cokr/xit/base/file/FileInfo.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/cokr/xit/base/file/FileInfo.java b/src/main/java/cokr/xit/base/file/FileInfo.java index 686bf82..7358c0e 100644 --- a/src/main/java/cokr/xit/base/file/FileInfo.java +++ b/src/main/java/cokr/xit/base/file/FileInfo.java @@ -14,8 +14,6 @@ import java.util.List; import java.util.stream.Collectors; import java.util.stream.Stream; -import org.springframework.util.FileCopyUtils; - import cokr.xit.foundation.AbstractComponent; import cokr.xit.foundation.AbstractEntity; import cokr.xit.foundation.Assert; @@ -530,12 +528,12 @@ public class FileInfo extends AbstractEntity { * */ public boolean write(OutputStream out) { - if (Assert.isEmpty(path) || out == null) return false; + if (out == null) return false; try ( InputStream in = getInputStream(); ) { - FileCopyUtils.copy(in, out); + in.transferTo(out); return true; } catch (Exception e) { throw Assert.runtimeException(e);