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.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
import org.springframework.util.FileCopyUtils;
import cokr.xit.foundation.AbstractComponent; import cokr.xit.foundation.AbstractComponent;
import cokr.xit.foundation.AbstractEntity; import cokr.xit.foundation.AbstractEntity;
import cokr.xit.foundation.Assert; import cokr.xit.foundation.Assert;
@ -530,12 +528,12 @@ public class FileInfo extends AbstractEntity {
* </ul> * </ul>
*/ */
public boolean write(OutputStream out) { public boolean write(OutputStream out) {
if (Assert.isEmpty(path) || out == null) return false; if (out == null) return false;
try ( try (
InputStream in = getInputStream(); InputStream in = getInputStream();
) { ) {
FileCopyUtils.copy(in, out); in.transferTo(out);
return true; return true;
} catch (Exception e) { } catch (Exception e) {
throw Assert.runtimeException(e); throw Assert.runtimeException(e);

Loading…
Cancel
Save