write(OutputStream) 수정

master
mjkhan21 4 weeks ago
parent c42812caab
commit debef76c0d

@ -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 {
* </ul>
*/
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);

Loading…
Cancel
Save