mkdirs(..) 수정: ensureDir(..) 호출

master
mjkhan21 11 months ago
parent 54d30062e3
commit 544d1f62f2

@ -1,8 +1,6 @@
package cokr.xit.base.file.service.bean;
import java.io.File;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import javax.annotation.Resource;
@ -130,15 +128,10 @@ public class FileBean extends AbstractBean {
* @throws Exception
*/
protected void mkdirs(List<FileInfo> files) throws Exception {
Set<String> dirs = files.stream()
files.stream()
.map(file -> FileInfo.dir(file.getPath()))
.collect(Collectors.toSet());
for (String path: dirs) {
File dir = new File(path);
if (!dir.exists())
dir.mkdirs();
}
.collect(Collectors.toSet())
.forEach(FileBean::ensureDir);
}
/** .

Loading…
Cancel
Save